Interface ImmutableFieldValidator<E extends EntityType<E>,​T>

  • Type Parameters:
    E - entity type
    T - immutable field type
    All Superinterfaces:
    ChangeValidator
    All Known Implementing Classes:
    ImmutableFieldValidatorImpl

    public interface ImmutableFieldValidator<E extends EntityType<E>,​T>
    extends ChangeValidator
    A validator that prevents a field from being modified (can only be set by a CREATE command).
    • Method Detail

      • immutableField

        EntityField<E,​T> immutableField()
        Returns:
        the field that should not be modified
      • getErrorCode

        java.lang.String getErrorCode()
        Returns:
        the error code to return if a modification of the field is attempted
      • fetchFields

        default java.util.stream.Stream<EntityField<?,​?>> fetchFields()
        Returns:
        a list of fields to fetch.
      • immutableWhen

        default java.util.function.Predicate<CurrentEntityState> immutableWhen()
        Returns:
        Predicate when should validate field.