Interface EntityChangeValidator<E extends EntityType<E>>
-
- Type Parameters:
E- entity type
public interface EntityChangeValidator<E extends EntityType<E>>A validator that checks number of fields and uses entity and parent fields for the verification.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.stream.Stream<? extends EntityField<?,?>>fetchFields()SupportedChangeOperationgetSupportedChangeOperation()ValidationErrorvalidate(EntityChange<E> entityChange, CurrentEntityState currentState)Called by the framework to validate the fields in entity change.java.util.stream.Stream<EntityField<E,?>>validatedFields()
-
-
-
Method Detail
-
validatedFields
java.util.stream.Stream<EntityField<E,?>> validatedFields()
- Returns:
- the field validated by this validator
-
getSupportedChangeOperation
SupportedChangeOperation getSupportedChangeOperation()
- Returns:
- the supported change operation
-
fetchFields
java.util.stream.Stream<? extends EntityField<?,?>> fetchFields()
- 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 infetchFields().- Parameters:
entityChange- entity changecurrentState- existing entity- Returns:
- a validation error if any,
nullif none
-
-