Package com.exedio.cope
Class IntegerField
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Field<E>
-
- com.exedio.cope.FunctionField<E>
-
- com.exedio.cope.NumberField<Integer>
-
- com.exedio.cope.IntegerField
-
- All Implemented Interfaces:
Copyable
,Function<Integer>
,NumberFunction<Integer>
,Selectable<Integer>
,Settable<Integer>
,Serializable
public final class IntegerField extends NumberField<Integer>
Represents a field within atype
, that enables instances of that type to store a integer.- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntegerField()
Creates a new mandatoryIntegerField
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
checkDefaultToNext()
Deprecated.UsecheckSequenceBehindDefaultToNext()
.isBehindBy
() insteadSequenceBehindInfo
checkSequenceBehindDefaultToNext()
Deprecated.UsecheckSequenceBehindDefaultToNextX()
instead, but regard the exceptionSequenceBehindInfo
checkSequenceBehindDefaultToNextX()
IntegerField
copy()
IntegerField
copyFrom(ItemField<?> copyFrom)
IntegerField
defaultTo(Integer defaultConstant)
IntegerField
defaultToNext(int start)
Condition
equal(Integer value)
Returns a condition, that is true for all items, if and only if the value of this function for that item is equal to the given parameter.Sequence
getDefaultNext()
Deprecated.UsegetDefaultNextSequence()
instead, but regard the exceptionSequence
getDefaultNextSequence()
Integer
getDefaultNextStart()
Deprecated.UsegetDefaultNextStartX()
instead, but regard the exceptionint
getDefaultNextStartX()
SequenceInfo
getDefaultToNextInfo()
Deprecated.UsegetDefaultToNextInfoX()
instead, but regard the exceptionSequenceInfo
getDefaultToNextInfoX()
Set<Class<? extends Throwable>>
getInitialExceptions()
Returns the exceptions possibly thrown, when setting a value for this settable.int
getMandatory(Item item)
int
getMaximum()
int
getMinimum()
com.exedio.cope.SelectType<Integer>
getValueType()
boolean
isDefaultNext()
Returns whether this field defaults to next value of a sequence.IntegerField
max(int maximum)
IntegerField
min(int minimum)
IntegerField
noCopyFrom()
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.IntegerField
noDefault()
IntegerField
nonUnique()
Condition
notEqual(Integer value)
IntegerField
optional()
Returns a new Field, that differs from this Field by being optional.IntegerField
range(int minimum, int maximum)
IntegerField
rangeDigits(int digits)
IntegerField
rangeDigits(int minimumDigits, int maximumDigits)
<P extends Item>
PsearchUnique(Class<P> typeClass, int value)
Finds an item by it's unique fields.void
set(Item item, int value)
IntegerField
toFinal()
Returns a new Field, that differs from this Field by being final.IntegerField
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, get, get, greater, greater, greaterOrEqual, greaterOrEqual, in, in, isNotNull, isNull, less, less, lessOrEqual, lessOrEqual, max, min, 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 IntegerField copy()
- Specified by:
copy
in classFunctionField<Integer>
-
toFinal
public IntegerField 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<Integer>
- See Also:
Field.isFinal()
-
optional
public IntegerField 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<Integer>
- See Also:
Field.isMandatory()
-
unique
public IntegerField 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<Integer>
- See Also:
FunctionField.getImplicitUniqueConstraint()
-
nonUnique
public IntegerField nonUnique()
- Specified by:
nonUnique
in classFunctionField<Integer>
-
copyFrom
public IntegerField copyFrom(ItemField<?> copyFrom)
- Specified by:
copyFrom
in classFunctionField<Integer>
- See Also:
ItemField.copyTo(FunctionField)
-
noCopyFrom
public IntegerField 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<Integer>
-
noDefault
public IntegerField noDefault()
- Specified by:
noDefault
in classFunctionField<Integer>
-
defaultTo
public IntegerField defaultTo(Integer defaultConstant)
- Specified by:
defaultTo
in classFunctionField<Integer>
-
defaultToNext
public IntegerField defaultToNext(int start)
-
range
public IntegerField range(int minimum, int maximum)
-
min
public IntegerField min(int minimum)
-
max
public IntegerField max(int maximum)
-
isDefaultNext
public boolean isDefaultNext()
Returns whether this field defaults to next value of a sequence.
-
getDefaultNextStartX
public int getDefaultNextStartX()
- Throws:
IllegalArgumentException
- if this field does notdefault to next value of a sequence
.
-
getDefaultNextSequence
public Sequence getDefaultNextSequence()
- Throws:
IllegalArgumentException
- if this field does notdefault to next value of a sequence
.
-
getMinimum
public int getMinimum()
-
getMaximum
public int 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<Integer>
- Overrides:
getInitialExceptions
in classFunctionField<Integer>
-
getValueType
public com.exedio.cope.SelectType<Integer> getValueType()
-
getMandatory
public int getMandatory(@Nonnull Item item)
- Throws:
IllegalArgumentException
- if this field is notmandatory
.
-
searchUnique
@Nullable public <P extends Item> P searchUnique(Class<P> typeClass, int value)
Finds an item by it's unique fields.- Returns:
- null if there is no matching item.
- See Also:
FunctionField.searchUnique(Class, Object)
-
getDefaultToNextInfoX
public SequenceInfo getDefaultToNextInfoX()
- Throws:
IllegalArgumentException
- if this field does notdefault to next value of a sequence
.
-
checkSequenceBehindDefaultToNextX
public SequenceBehindInfo checkSequenceBehindDefaultToNextX()
- Throws:
IllegalArgumentException
- if this field does notdefault to next value of a sequence
.
-
rangeDigits
public IntegerField rangeDigits(int digits)
-
rangeDigits
public IntegerField rangeDigits(int minimumDigits, int maximumDigits)
-
equal
public Condition equal(Integer value)
Description copied from interface:Function
Returns a condition, that is true for all items, if and only if the value of this function for that item is equal to the given parameter.
-
getDefaultNextStart
@Deprecated public Integer getDefaultNextStart()
Deprecated.UsegetDefaultNextStartX()
instead, but regard the exceptionReturns null, if this field does notdefault to next value of a sequence
.
-
getDefaultNext
@Deprecated public Sequence getDefaultNext()
Deprecated.UsegetDefaultNextSequence()
instead, but regard the exceptionReturns null, if this field does notdefault to next value of a sequence
.
-
getDefaultToNextInfo
@Deprecated public SequenceInfo getDefaultToNextInfo()
Deprecated.UsegetDefaultToNextInfoX()
instead, but regard the exceptionReturns null, if this field does notdefault to next value of a sequence
.
-
checkDefaultToNext
@Deprecated public int checkDefaultToNext()
Deprecated.UsecheckSequenceBehindDefaultToNext()
.isBehindBy
() instead- Throws:
IllegalStateException
- is a transaction is bound to the current thread
-
checkSequenceBehindDefaultToNext
@Deprecated public SequenceBehindInfo checkSequenceBehindDefaultToNext()
Deprecated.UsecheckSequenceBehindDefaultToNextX()
instead, but regard the exceptionReturns null, if this field does notdefault to next value of a sequence
.- Throws:
IllegalStateException
- is a transaction is bound to the current thread
-
-