Package com.exedio.cope
Class IntegerField
- All Implemented Interfaces:
Copyable
,Function<Integer>
,NumberFunction<Integer>
,Selectable<Integer>
,Settable<Integer>
,Serializable
Represents a field within a
type
,
that enables instances of that type to store a integer.- Author:
- Ralf Wiebicke
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.Deprecated.UsecheckSequenceBehindDefaultToNextX()
instead, but regard the exceptioncopy()
defaultToNext
(int start) 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.Deprecated.UsegetDefaultNextSequence()
instead, but regard the exceptionDeprecated.UsegetDefaultNextStartX()
instead, but regard the exceptionint
Deprecated.UsegetDefaultToNextInfoX()
instead, but regard the exceptionReturns the exceptions possibly thrown, when setting a value for this settable.int
getMandatory
(Item item) int
int
com.exedio.cope.SelectType<Integer>
boolean
Returns whether this field defaults to next value of a sequence.max
(int maximum) min
(int minimum) Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.optional()
Returns a new Field, that differs from this Field by being optional.range
(int minimum, int maximum) rangeDigits
(int digits) rangeDigits
(int minimumDigits, int maximumDigits) <P extends Item>
PsearchUnique
(Class<P> typeClass, int value) Finds an item by it's unique fields.void
toFinal()
Returns a new Field, that differs from this Field by being final.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
-
Constructor Details
-
IntegerField
public IntegerField()Creates a new mandatoryIntegerField
.
-
-
Method Details
-
copy
- Specified by:
copy
in classFunctionField<Integer>
-
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:
-
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:
-
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:
-
nonUnique
- Specified by:
nonUnique
in classFunctionField<Integer>
-
copyFrom
- Specified by:
copyFrom
in classFunctionField<Integer>
- See Also:
-
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
- Specified by:
noDefault
in classFunctionField<Integer>
-
defaultTo
- Specified by:
defaultTo
in classFunctionField<Integer>
-
defaultToNext
-
range
-
min
-
max
-
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
- Throws:
IllegalArgumentException
- if this field does notdefault to next value of a sequence
.
-
getMinimum
public int getMinimum() -
getMaximum
public int getMaximum() -
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
-
getMandatory
- Throws:
IllegalArgumentException
- if this field is notmandatory
.
-
set
-
searchUnique
Finds an item by it's unique fields.- Returns:
- null if there is no matching item.
- See Also:
-
getDefaultToNextInfoX
- Throws:
IllegalArgumentException
- if this field does notdefault to next value of a sequence
.
-
checkSequenceBehindDefaultToNextX
- Throws:
IllegalArgumentException
- if this field does notdefault to next value of a sequence
.
-
rangeDigits
-
rangeDigits
-
equal
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. -
notEqual
-
getDefaultNextStart
Deprecated.UsegetDefaultNextStartX()
instead, but regard the exceptionReturns null, if this field does notdefault to next value of a sequence
. -
getDefaultNext
Deprecated.UsegetDefaultNextSequence()
instead, but regard the exceptionReturns null, if this field does notdefault to next value of a sequence
. -
getDefaultToNextInfo
Deprecated.UsegetDefaultToNextInfoX()
instead, but regard the exceptionReturns null, if this field does notdefault to next value of a sequence
. -
checkDefaultToNext
Deprecated.UsecheckSequenceBehindDefaultToNext()
.isBehindBy
() instead- Throws:
IllegalStateException
- is a transaction is bound to the current thread
-
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
-
checkSequenceBehindDefaultToNext()
.isBehindBy
() instead