Interface ChangeValidatorAdapter<E extends EntityType<E>>
-
- All Known Implementing Classes:
AncestorsValidationAdapter,EntityChangeValidatorAdapter,FieldComplexValidationAdapter,FieldsCombinationValidationAdapter,FieldValidationAdapter,ImmutableFieldValidationAdapter,PrototypeFieldComplexValidationAdapter,PrototypeFieldsCombinationValidationAdapter,PrototypeFieldValidationAdapter,RequiredFieldValidationAdapter
public interface ChangeValidatorAdapter<E extends EntityType<E>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.stream.Stream<? extends EntityField<?,?>>fieldsToFetch()SupportedChangeOperationgetSupportedChangeOperation()ValidationTrigger<E>trigger()ValidationErrorvalidate(EntityChange<E> entityChange, CurrentEntityState currentState)Called by the framework to validate the fields in entity change.
-
-
-
Method Detail
-
trigger
ValidationTrigger<E> trigger()
- Returns:
- the validation trigger
-
getSupportedChangeOperation
SupportedChangeOperation getSupportedChangeOperation()
- Returns:
- the supported change operation
-
fieldsToFetch
java.util.stream.Stream<? extends EntityField<?,?>> fieldsToFetch()
- Returns:
- a list of fields to fetch
-
validate
ValidationError validate(EntityChange<E> entityChange, CurrentEntityState currentState)
Called by the framework to validate the fields in entity change. The implementation can query theentityonly for the fields it has declared infieldsToFetch().- Parameters:
entityChange- entity changecurrentState- existing entity- Returns:
- a validation error if any,
nullif none
-
-