Class ValidationResult
java.lang.Object
se.idsec.signservice.integration.core.validation.ValidationResult
Class holding validation results (errors).
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the "field" errors of this object.Returns the global error message for this object (if any)Gets the name for the object that was validated.boolean
Predicate telling if this object holds any errors.void
Register an error for the entire object.void
rejectValue
(String field, String msg) Register an error for a specific field.void
setFieldErrors
(ValidationResult result) If an underlying object (to this object) has been verified, its result should be installed.toString()
-
Constructor Details
-
ValidationResult
Constructor.- Parameters:
objectName
- the name for the object that is validated (null for no name)
-
-
Method Details
-
getObjectName
Gets the name for the object that was validated.- Returns:
- the name for the object that was validated (null if the object isn't given a name)
-
hasErrors
public boolean hasErrors()Predicate telling if this object holds any errors.- Returns:
- true if this object holds errors and false otherwise
-
getGlobalError
Returns the global error message for this object (if any)- Returns:
- the global error message or null
-
getFieldErrors
Returns the "field" errors of this object.- Returns:
- a map (possibly empty) with field names and their error messages
-
reject
Register an error for the entire object.- Parameters:
msg
- the error message
-
rejectValue
Register an error for a specific field.- Parameters:
field
- the field namemsg
- the error message
-
setFieldErrors
If an underlying object (to this object) has been verified, its result should be installed.- Parameters:
result
- the result from the underlying object
-
toString
-