Class ValidationResult.Builder
java.lang.Object
com.iizix.server.geo.ip2location.ValidationResult.Builder
- Enclosing class:
ValidationResult
Collects the messages of a validation and builds the result.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionAdds an error.addWarning(String field, String message) Adds a warning.build()Builds the result.booleanChecks for errors collected so far.
Method Details
addError
Adds an error.- Parameters:
field- The field name.message- The text; null or empty adds nothing.- Returns:
- This builder.
addWarning
Adds a warning.- Parameters:
field- The field name.message- The text; null or empty adds nothing.- Returns:
- This builder.
hasErrors
public boolean hasErrors()Checks for errors collected so far.- Returns:
- true if at least one error was added.
build
Builds the result.- Returns:
- The result, the shared
ValidationResult.valid()when nothing was added.