Package com.exedio.cope
Class LongField
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Field<E>
-
- com.exedio.cope.FunctionField<E>
-
- com.exedio.cope.NumberField<Long>
-
- com.exedio.cope.LongField
-
- All Implemented Interfaces:
Copyable
,Function<Long>
,NumberFunction<Long>
,Selectable<Long>
,Settable<Long>
,Serializable
public final class LongField extends NumberField<Long>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LongField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LongField
copy()
LongField
copyFrom(ItemField<?> copyFrom)
LongField
defaultTo(Long defaultConstant)
LongField
defaultToRandom(Random source)
Set<Class<? extends Throwable>>
getInitialExceptions()
Returns the exceptions possibly thrown, when setting a value for this settable.long
getMandatory(Item item)
long
getMaximum()
long
getMinimum()
com.exedio.cope.SelectType<Long>
getValueType()
LongField
max(long maximum)
LongField
min(long minimum)
LongField
noCopyFrom()
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.LongField
noDefault()
LongField
nonUnique()
LongField
optional()
Returns a new Field, that differs from this Field by being optional.LongField
range(long minimum, long maximum)
LongField
rangeDigits(int digits)
LongField
rangeDigits(int minimumDigits, int maximumDigits)
<P extends Item>
PsearchUnique(Class<P> typeClass, long value)
Finds an item by it's unique fields.void
set(Item item, long value)
LongField
toFinal()
Returns a new Field, that differs from this Field by being final.LongField
unique()
Returns a new FunctionField, that differs from this FunctionField by being unique.-
Methods inherited from class com.exedio.cope.NumberField
avg
-
Methods inherited from class com.exedio.cope.FunctionField
addCopyFrom, append, appendSelect, check, copy, copyFunctionField, get, get, getDefaultConstant, getImplicitCopyConstraint, getImplicitCopyConstraints, getImplicitUniqueConstraint, 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, equal, equal, equal, get, get, greater, greater, greaterOrEqual, greaterOrEqual, in, in, isNotNull, isNull, less, less, lessOrEqual, lessOrEqual, max, min, notEqual, notEqual
-
Methods inherited from interface com.exedio.cope.NumberFunction
asString, average, bind, divide, minus, multiply, multiply, plus, plus, sum, sum
-
Methods inherited from interface com.exedio.cope.Selectable
append, appendSelect, check, getType, getValueClass, toString
-
-
-
-
Method Detail
-
copy
public LongField copy()
- Specified by:
copy
in classFunctionField<Long>
-
toFinal
public LongField 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<Long>
- See Also:
Field.isFinal()
-
optional
public LongField 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<Long>
- See Also:
Field.isMandatory()
-
unique
public LongField 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<Long>
- See Also:
FunctionField.getImplicitUniqueConstraint()
-
nonUnique
public LongField nonUnique()
- Specified by:
nonUnique
in classFunctionField<Long>
-
copyFrom
public LongField copyFrom(ItemField<?> copyFrom)
- Specified by:
copyFrom
in classFunctionField<Long>
- See Also:
ItemField.copyTo(FunctionField)
-
noCopyFrom
public LongField 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<Long>
-
noDefault
public LongField noDefault()
- Specified by:
noDefault
in classFunctionField<Long>
-
defaultTo
public LongField defaultTo(Long defaultConstant)
- Specified by:
defaultTo
in classFunctionField<Long>
-
range
public LongField range(long minimum, long maximum)
-
min
public LongField min(long minimum)
-
max
public LongField max(long maximum)
-
getMinimum
public long getMinimum()
-
getMaximum
public long getMaximum()
-
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 interfaceSettable<Long>
- Overrides:
getInitialExceptions
in classFunctionField<Long>
-
getValueType
public com.exedio.cope.SelectType<Long> getValueType()
-
getMandatory
public long getMandatory(@Nonnull Item item)
- Throws:
IllegalArgumentException
- if this field is notmandatory
.
-
searchUnique
@Nullable public <P extends Item> P searchUnique(Class<P> typeClass, long value)
Finds an item by it's unique fields.- Returns:
- null if there is no matching item.
- See Also:
FunctionField.searchUnique(Class, Object)
-
rangeDigits
public LongField rangeDigits(int digits)
-
rangeDigits
public LongField rangeDigits(int minimumDigits, int maximumDigits)
-
-