Package com.exedio.cope
Class FunctionField<E>
java.lang.Object
com.exedio.cope.Feature
com.exedio.cope.Field<E>
com.exedio.cope.FunctionField<E>
- All Implemented Interfaces:
Copyable
,Function<E>
,Selectable<E>
,Settable<E>
,Serializable
- Direct Known Subclasses:
BooleanField
,DateField
,DayField
,EnumField
,ItemField
,NumberField
,StringField
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionprotected final ItemField<?>[]
addCopyFrom
(ItemField<?> copyFrom) final void
Deprecated.For internal use within COPE only.void
appendSelect
(com.exedio.cope.Statement bf, Join join) Deprecated.For internal use within COPE only.final void
Deprecated.For internal use within COPE only.abstract FunctionField<E>
copy()
final FunctionField<E>
copy
(CopyMapper mapper) abstract FunctionField<E>
final FunctionField<E>
Deprecated.Renamed tocopy()
.abstract FunctionField<E>
final E
get
(FieldValues item) final E
final E
Deprecated.UsegetImplicitCopyConstraints()
instead.Deprecated.This method makes no sense anymore, since there is aItemField.copyTo(FunctionField)
as well.Returns the unique constraint of this field, that has been created implicitly when creating this field.Returns the exceptions possibly thrown, when setting a value for this settable.Returns a list of unique constraints this field is part of.final boolean
final boolean
Returns true, if a value for the field should be specified on the creation of an item.final boolean
abstract FunctionField<E>
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.abstract FunctionField<E>
abstract FunctionField<E>
abstract FunctionField<E>
optional()
Returns a new Field, that differs from this Field by being optional.final Item
searchUnique
(E value) Finds an item by it's unique fields.final <P extends Item>
PsearchUnique
(Class<P> typeClass, E value) Finds an item by it's unique fields.final <P extends Item>
PsearchUniqueStrict
(Class<P> typeClass, E value) Finds an item by its unique fields.final void
abstract FunctionField<E>
toFinal()
Returns a new Field, that differs from this Field by being final.abstract FunctionField<E>
unique()
Returns a new FunctionField, that differs from this FunctionField by being unique.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, getValueType, toString
-
Method Details
-
hasDefault
public final boolean hasDefault() -
getDefaultConstant
-
isInitial
public final boolean isInitial()Returns true, if a value for the field should be specified on the creation of an item. This implementation returns({@link #isFinal() isFinal()} || {@link #isMandatory() isMandatory()}) && !{@link #hasDefault()}
. -
addCopyFrom
-
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. -
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. -
copy
-
copy
-
unique
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.- See Also:
-
nonUnique
-
copyFrom
- See Also:
-
noCopyFrom
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set. -
noDefault
-
defaultTo
-
get
-
get
-
set
-
check
Deprecated.For internal use within COPE only.- Specified by:
check
in interfaceSelectable<E>
-
append
Deprecated.For internal use within COPE only.- Specified by:
append
in interfaceSelectable<E>
-
appendSelect
Deprecated.For internal use within COPE only.- Specified by:
appendSelect
in interfaceSelectable<E>
-
getImplicitUniqueConstraint
Returns the unique constraint of this field, that has been created implicitly when creating this field. Does return null, if there is no such unique constraint.- See Also:
-
getUniqueConstraints
Returns a list of unique constraints this field is part of. This includes animplicit unique constraint
, if there is one for this field. -
getImplicitCopyConstraint
Deprecated.UsegetImplicitCopyConstraints()
instead. Throws a RuntimeException, ifgetImplicitCopyConstraints()
returns more than one constraint.Returns the copy constraint of this field, that has been created implicitly when creating this field. Does return null, if there is no such copy constraint. -
getImplicitCopyConstraints
Deprecated.This method makes no sense anymore, since there is aItemField.copyTo(FunctionField)
as well.Returns the copy constraints of this field, that has been created implicitly when creating this field. Does return an empty list, if there is no such copy constraint. -
getInitialExceptions
Description copied from interface:Settable
Returns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptions
in interfaceSettable<E>
- Overrides:
getInitialExceptions
in classField<E>
-
isRedundantByCopyConstraint
public final boolean isRedundantByCopyConstraint() -
searchUnique
Finds an item by it's unique fields.- Returns:
- null if there is no matching item.
- Throws:
NullPointerException
- if value is null.
-
searchUnique
Finds an item by it's unique fields.- Returns:
- null if there is no matching item.
- Throws:
NullPointerException
- if value is null.
-
searchUniqueStrict
@Nonnull public final <P extends Item> P searchUniqueStrict(Class<P> typeClass, @Nonnull E value) throws IllegalArgumentException Finds an item by its unique fields.- Throws:
NullPointerException
- if value is null.IllegalArgumentException
- if there is no matching item.
-
copyFunctionField
Deprecated.Renamed tocopy()
.
-