Package com.exedio.cope
Class EnumField<E extends Enum<E>>
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Field<E>
-
- com.exedio.cope.FunctionField<E>
-
- com.exedio.cope.EnumField<E>
-
- All Implemented Interfaces:
Copyable
,Function<E>
,Selectable<E>
,Settable<E>
,Serializable
public final class EnumField<E extends Enum<E>> extends FunctionField<E>
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <X extends Enum<X>>
EnumField<X>as(Class<X> clazz)
<X extends Enum<X>>
EnumField<X>cast(Class<X> clazz)
Deprecated.Useas(Class)
insteadEnumField<E>
copy()
EnumField<E>
copyFrom(ItemField<?> copyFrom)
static <E extends Enum<E>>
EnumField<E>create(Class<E> valueClass)
EnumField<E>
defaultTo(E defaultConstant)
int
getColumnValue(E value)
Deprecated.UseSchemaInfo.getColumnValue(EnumField,Enum)
insteadE
getValue(String code)
List<E>
getValues()
com.exedio.cope.SelectType<E>
getValueType()
EnumField<E>
noCopyFrom()
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.EnumField<E>
noDefault()
EnumField<E>
nonUnique()
EnumField<E>
optional()
Returns a new Field, that differs from this Field by being optional.EnumField<E>
toFinal()
Returns a new Field, that differs from this Field by being final.EnumField<E>
unique()
Returns a new FunctionField, that differs from this FunctionField by being unique.-
Methods inherited from class com.exedio.cope.FunctionField
addCopyFrom, append, appendSelect, check, copy, copyFunctionField, get, get, getDefaultConstant, getImplicitCopyConstraint, getImplicitCopyConstraints, getImplicitUniqueConstraint, getInitialExceptions, getUniqueConstraints, hasDefault, isInitial, isRedundantByCopyConstraint, searchUnique, searchUnique, searchUniqueStrict, set
-
Methods inherited from class com.exedio.cope.Field
castCollection, check, execute, getColumnName, getInitialType, getPatterns, getValueClass, isFinal, isMandatory, mapNull
-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.exedio.cope.Function
any, between, bind, equal, equal, equal, greater, greater, greaterOrEqual, greaterOrEqual, in, in, isNotNull, isNull, less, less, lessOrEqual, lessOrEqual, max, min, notEqual, notEqual
-
Methods inherited from interface com.exedio.cope.Selectable
getType, getValueClass, toString
-
-
-
-
Method Detail
-
toFinal
public EnumField<E> toFinal()
Description copied from class:Field
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.- Specified by:
toFinal
in classFunctionField<E extends Enum<E>>
- See Also:
Field.isFinal()
-
optional
public EnumField<E> optional()
Description copied from class:Field
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.- Specified by:
optional
in classFunctionField<E extends Enum<E>>
- See Also:
Field.isMandatory()
-
unique
public EnumField<E> unique()
Description copied from class:FunctionField
Returns a new FunctionField, that differs from this FunctionField by being unique. If this FunctionField is already unique, the the result is equal to this FunctionField.- Specified by:
unique
in classFunctionField<E extends Enum<E>>
- See Also:
FunctionField.getImplicitUniqueConstraint()
-
nonUnique
public EnumField<E> nonUnique()
- Specified by:
nonUnique
in classFunctionField<E extends Enum<E>>
-
copyFrom
public EnumField<E> copyFrom(ItemField<?> copyFrom)
- Specified by:
copyFrom
in classFunctionField<E extends Enum<E>>
- See Also:
ItemField.copyTo(FunctionField)
-
noCopyFrom
public EnumField<E> noCopyFrom()
Description copied from class:FunctionField
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.- Specified by:
noCopyFrom
in classFunctionField<E extends Enum<E>>
-
noDefault
public EnumField<E> noDefault()
- Specified by:
noDefault
in classFunctionField<E extends Enum<E>>
-
defaultTo
public EnumField<E> defaultTo(E defaultConstant)
- Specified by:
defaultTo
in classFunctionField<E extends Enum<E>>
-
getValueType
public com.exedio.cope.SelectType<E> getValueType()
-
getValue
public E getValue(String code)
- See Also:
Enum.valueOf(Class, String)
-
as
public <X extends Enum<X>> EnumField<X> as(Class<X> clazz)
- See Also:
ItemField.as(Class)
,Class.asSubclass(Class)
-
cast
@Deprecated public <X extends Enum<X>> EnumField<X> cast(Class<X> clazz)
Deprecated.Useas(Class)
instead
-
getColumnValue
@Deprecated public int getColumnValue(E value)
Deprecated.UseSchemaInfo.getColumnValue(EnumField,Enum)
instead
-
-