Interface Validator<T>
-
- Type Parameters:
T
- the type of object the validator will validate.
- All Known Implementing Classes:
AlwaysValid
,ElementValidator
,IsEdgeValidator
,IsElementValidator
,IsEntityValidator
public interface Validator<T>
AnValidator
validates objects of type T and returns true if they are valid.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
validate(T obj)
Validates the given object.default uk.gov.gchq.koryphe.ValidationResult
validateWithValidationResult(T obj)
Validates the given object and results a ValidationResult that can contain information as to why validation fails.
-
-
-
Method Detail
-
validate
boolean validate(T obj)
Validates the given object.- Parameters:
obj
- an object of type T to validate.- Returns:
- true if the provided object is valid.
-
validateWithValidationResult
default uk.gov.gchq.koryphe.ValidationResult validateWithValidationResult(T obj)
Validates the given object and results a ValidationResult that can contain information as to why validation fails.
It is less efficient than just calling validate as complex validation strings may be built to detail why objects are invalid.
- Parameters:
obj
- an object of type T to validate.- Returns:
- the ValidationResult.
-
-