Package org.keycloak.validate
Class ValidationResult
- java.lang.Object
- 
- org.keycloak.validate.ValidationResult
 
- 
 public class ValidationResult extends Object Denotes the result of a validation.
- 
- 
Field SummaryFields Modifier and Type Field Description static ValidationResultOKAn empty ValidationResult that's valid by default.
 - 
Constructor SummaryConstructors Constructor Description ValidationResult(Set<ValidationError> errors)Creates a newValidationResultfrom the given errors.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforEachError(Consumer<ValidationError> consumer)Convenience method that accepts aConsumer.Set<ValidationError>getErrors()Set<ValidationError>getErrorsForInputHint(String inputHint)Returns aSetofValidationError'swith the giveninputHintif present, otherwise an emptySetis returned.Set<ValidationError>getErrorsForValidatorId(String id)Returns aSetofValidationError'sfrom theValidatorwith the givenidif present, otherwise an emptySetis returned.booleanhasErrorsForInputHint(String inputHint)booleanhasErrorsForValidatorId(String id)voidifNotValidAccept(Consumer<ValidationResult> consumer)Convenience method that accepts aConsumerif the result is not valid.booleanisValid()
 
- 
- 
- 
Field Detail- 
OKpublic static final ValidationResult OK An empty ValidationResult that's valid by default.
 
- 
 - 
Constructor Detail- 
ValidationResultpublic ValidationResult(Set<ValidationError> errors) Creates a newValidationResultfrom the given errors.The created ValidationResultis considered valid if the givenerrorsare empty.- Parameters:
- errors-
 
 
- 
 - 
Method Detail- 
ifNotValidAcceptpublic void ifNotValidAccept(Consumer<ValidationResult> consumer) Convenience method that accepts aConsumerif the result is not valid.- Parameters:
- consumer-
 
 - 
forEachErrorpublic void forEachError(Consumer<ValidationError> consumer) Convenience method that accepts aConsumer.- Parameters:
- consumer-
 
 - 
isValidpublic boolean isValid() 
 - 
getErrorspublic Set<ValidationError> getErrors() 
 - 
hasErrorsForValidatorIdpublic boolean hasErrorsForValidatorId(String id) - Parameters:
- id-
- Returns:
 
 - 
getErrorsForValidatorIdpublic Set<ValidationError> getErrorsForValidatorId(String id) Returns aSetofValidationError'sfrom theValidatorwith the givenidif present, otherwise an emptySetis returned.- Parameters:
- id-
- Returns:
 
 - 
hasErrorsForInputHintpublic boolean hasErrorsForInputHint(String inputHint) Checks if thisValidationResultcontainsValidationError'swith the giveninputHint.This can be used to test if there are ValidationError'sfor a specified attribute or attribute path.- Parameters:
- inputHint-
- Returns:
 
 - 
getErrorsForInputHintpublic Set<ValidationError> getErrorsForInputHint(String inputHint) Returns aSetofValidationError'swith the giveninputHintif present, otherwise an emptySetis returned.- Parameters:
- inputHint-
- Returns:
 
 
- 
 
-