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 voidDeprecated.For internal use within COPE only.voidappendSelect(com.exedio.cope.Statement bf, Join join) Deprecated.For internal use within COPE only.final voidDeprecated.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 Eget(FieldValues item) final Efinal EDeprecated.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 booleanfinal booleanReturns true, if a value for the field should be specified on the creation of an item.final booleanabstract FunctionField<E>Returns a new FunctionField that differs from this FunctionField by having nocopyFromfields set.abstract FunctionField<E>abstract FunctionField<E>abstract FunctionField<E>optional()Returns a new Field, that differs from this Field by being optional.final ItemsearchUnique(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 voidabstract 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, mapNullMethods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, notEqualMethods 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:FieldReturns 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:FieldReturns 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 nocopyFromfields set. -
noDefault
-
defaultTo
-
get
-
get
-
set
-
check
Deprecated.For internal use within COPE only.- Specified by:
checkin interfaceSelectable<E>
-
append
Deprecated.For internal use within COPE only.- Specified by:
appendin interfaceSelectable<E>
-
appendSelect
Deprecated.For internal use within COPE only.- Specified by:
appendSelectin 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:SettableReturns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptionsin interfaceSettable<E>- Overrides:
getInitialExceptionsin 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().
-