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 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 the entity only for the fields it has declared in fetchFields().
        Parameters:
        entityChange - entity change
        currentState - existing entity
        Returns:
        a validation error if any, null if none