Class Field<E>

java.lang.Object
com.exedio.cope.Feature
com.exedio.cope.Field<E>
All Implemented Interfaces:
Settable<E>, Serializable
Direct Known Subclasses:
DataField, FunctionField

public abstract class Field<E> extends Feature implements Settable<E>
An field represents a persistently stored field of a Type. Subclasses specify the type of information to be stored in the field.
Author:
Ralf Wiebicke
See Also:
  • Method Details

    • toFinal

      public abstract Field<E> toFinal()
      Returns a new Field, that differs from this Field by being final. If this Field is already final, the the result is equal to this Field.
      See Also:
    • optional

      public abstract Field<E> optional()
      Returns a new Field, that differs from this Field by being optional. If this Field is already optional, the the result is equal to this Field.
      See Also:
    • isFinal

      public final boolean isFinal()
      Description copied from interface: Settable
      Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.
      Specified by:
      isFinal in interface Settable<E>
      See Also:
    • isMandatory

      public final boolean isMandatory()
      Specified by:
      isMandatory in interface Settable<E>
    • getInitialType

      public final Class<?> getInitialType()
      Specified by:
      getInitialType in interface Settable<E>
    • isInitial

      public boolean isInitial()
      Returns true, if a value for the field should be specified on the creation of an item. This default implementation returns {@link #isFinal()} || {@link #isMandatory()}.
      Specified by:
      isInitial in interface Settable<E>
    • getInitialExceptions

      public Set<Class<? extends Throwable>> getInitialExceptions()
      Description copied from interface: Settable
      Returns the exceptions possibly thrown, when setting a value for this settable.
      Specified by:
      getInitialExceptions in interface Settable<E>
    • getValueClass

      public final Class<E> getValueClass()
    • castCollection

      @Deprecated public final Collection<E> castCollection(Collection<?> c)
      Deprecated.
    • mapNull

      public final SetValue<E> mapNull()
    • execute

      public final SetValue<?>[] execute(E value, Item exceptionItem)
      Specified by:
      execute in interface Settable<E>
    • check

      public final void check(E value)
      Throws:
      ConstraintViolationException - if value does not satisfy constraints.
    • get

      public abstract E get(Item item)
    • set

      public abstract void set(Item item, E value)
    • getColumnName

      @Deprecated public final String getColumnName()
      Deprecated.
    • getPatterns

      @Deprecated public final List<Pattern> getPatterns()
      Deprecated.