I have a Java class Validator. It validates some file. Here it is in pseudo code:
public class Validator {
Collection<ValidationMessage> validationMessages;
class ValidationMessage {
}
enum MessageType {
}
public validate(lines) throws ValidationException {
for (line : lines) {
validateCriteriaA(line)
validateCriteriaB(line)
...
validateCriteriaF(line)
}
if (...)
throw new ValidationException();
}
private validateCriteriaA(Line line) {
if (...) {
validationMessages.add("criteria failed")
}
}
private validateCriteriaB(Line line)
private validateCriteriaC(Line line)
private validateCriteriaD(Line line)
private validateCriteriaE(Line line)
private validateCriteriaF(Line line)
private helperMethodX
private helperMethodY
private helperMethodZ
}
Each method has no more than 15 lines. The total length of this class is ~300 lines. Do you think it is a God object or some other bad smelling class? Is it some kind of anti-pattern? If you think it needs to be redesigned - please tell me how.