Package com.exedio.cope
Class BooleanField
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Field<E>
-
- com.exedio.cope.FunctionField<Boolean>
-
- com.exedio.cope.BooleanField
-
- All Implemented Interfaces:
Copyable
,Function<Boolean>
,Selectable<Boolean>
,Settable<Boolean>
,Serializable
public final class BooleanField extends FunctionField<Boolean>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BooleanField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanField
copy()
BooleanField
copyFrom(ItemField<?> copyFrom)
BooleanField
defaultTo(Boolean defaultConstant)
boolean
getMandatory(Item item)
com.exedio.cope.SelectType<Boolean>
getValueType()
BooleanField
noCopyFrom()
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.BooleanField
noDefault()
BooleanField
nonUnique()
BooleanField
optional()
Returns a new Field, that differs from this Field by being optional.<P extends Item>
PsearchUnique(Class<P> typeClass, boolean value)
Finds an item by it's unique fields.void
set(Item item, boolean value)
BooleanField
toFinal()
Returns a new Field, that differs from this Field by being final.BooleanField
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
-
copy
public BooleanField copy()
- Specified by:
copy
in classFunctionField<Boolean>
-
toFinal
public BooleanField 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<Boolean>
- See Also:
Field.isFinal()
-
optional
public BooleanField 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<Boolean>
- See Also:
Field.isMandatory()
-
unique
public BooleanField 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<Boolean>
- See Also:
FunctionField.getImplicitUniqueConstraint()
-
nonUnique
public BooleanField nonUnique()
- Specified by:
nonUnique
in classFunctionField<Boolean>
-
copyFrom
public BooleanField copyFrom(ItemField<?> copyFrom)
- Specified by:
copyFrom
in classFunctionField<Boolean>
- See Also:
ItemField.copyTo(FunctionField)
-
noCopyFrom
public BooleanField 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<Boolean>
-
noDefault
public BooleanField noDefault()
- Specified by:
noDefault
in classFunctionField<Boolean>
-
defaultTo
public BooleanField defaultTo(Boolean defaultConstant)
- Specified by:
defaultTo
in classFunctionField<Boolean>
-
getValueType
public com.exedio.cope.SelectType<Boolean> getValueType()
-
getMandatory
public boolean getMandatory(@Nonnull Item item)
- Throws:
IllegalArgumentException
- if this field is notmandatory
.
-
searchUnique
@Nullable public <P extends Item> P searchUnique(@Nonnull Class<P> typeClass, boolean value)
Finds an item by it's unique fields.- Returns:
- null if there is no matching item.
- See Also:
FunctionField.searchUnique(Class, Object)
-
-