Package com.exedio.cope
Class DateField
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Field<E>
-
- com.exedio.cope.FunctionField<Date>
-
- com.exedio.cope.DateField
-
- All Implemented Interfaces:
Copyable
,Function<Date>
,Selectable<Date>
,Settable<Date>
,Serializable
public final class DateField extends FunctionField<Date>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DateField.Precision
static class
DateField.RoundingMode
-
Constructor Summary
Constructors Constructor Description DateField()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DateField
copy()
DateField
copyFrom(ItemField<?> copyFrom)
DateField
defaultTo(Date defaultConstant)
DateField
defaultToNow()
static Date
getDefaultMaximum()
static Date
getDefaultMinimum()
Set<Class<? extends Throwable>>
getInitialExceptions()
Returns the exceptions possibly thrown, when setting a value for this settable.Date
getMaximum()
Date
getMinimum()
DateField.Precision
getPrecision()
DateField.RoundingMode
getRoundingMode()
com.exedio.cope.SelectType<Date>
getValueType()
CompareCondition<Date>
greater(Date value)
Returns a condition, that is true for all items, if and only if the value of this function for that item is greater than the given parameter.CompareCondition<Date>
greaterOrEqual(Date value)
Returns a condition, that is true for all items, if and only if the value of this function for that item is not less than the given parameter.boolean
isDefaultNow()
CompareCondition<Date>
less(Date value)
Returns a condition, that is true for all items, if and only if the value of this function for that item is less than the given parameter.CompareCondition<Date>
lessOrEqual(Date value)
Returns a condition, that is true for all items, if and only if the value of this function for that item is not greater than the given parameter.SetValue<Date>
mapRounded(Date value, DateField.RoundingMode roundingMode)
DateField
noCopyFrom()
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.DateField
noDefault()
DateField
nonUnique()
DateField
optional()
Returns a new Field, that differs from this Field by being optional.DateField
precisionHour()
DateField
precisionMinute()
DateField
precisionSecond()
DateField
roundingMode(DateField.RoundingMode roundingMode)
void
setRounded(Item item, Date value)
void
setRounded(Item item, Date value, DateField.RoundingMode roundingMode)
DateField
toFinal()
Returns a new Field, that differs from this Field by being final.void
touch(Item item)
DateField
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, 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, greaterOrEqual, in, in, isNotNull, isNull, less, lessOrEqual, max, min, notEqual, notEqual
-
Methods inherited from interface com.exedio.cope.Selectable
getType, getValueClass, toString
-
-
-
-
Method Detail
-
getDefaultMinimum
public static Date getDefaultMinimum()
-
getDefaultMaximum
public static Date getDefaultMaximum()
-
copy
public DateField copy()
- Specified by:
copy
in classFunctionField<Date>
-
toFinal
public DateField 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<Date>
- See Also:
Field.isFinal()
-
optional
public DateField 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<Date>
- See Also:
Field.isMandatory()
-
unique
public DateField 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<Date>
- See Also:
FunctionField.getImplicitUniqueConstraint()
-
nonUnique
public DateField nonUnique()
- Specified by:
nonUnique
in classFunctionField<Date>
-
copyFrom
public DateField copyFrom(ItemField<?> copyFrom)
- Specified by:
copyFrom
in classFunctionField<Date>
- See Also:
ItemField.copyTo(FunctionField)
-
noCopyFrom
public DateField 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<Date>
-
noDefault
public DateField noDefault()
- Specified by:
noDefault
in classFunctionField<Date>
-
defaultTo
public DateField defaultTo(Date defaultConstant)
- Specified by:
defaultTo
in classFunctionField<Date>
-
defaultToNow
public DateField defaultToNow()
-
isDefaultNow
public boolean isDefaultNow()
-
getMinimum
public Date getMinimum()
-
getMaximum
public Date getMaximum()
-
precisionSecond
public DateField precisionSecond()
-
precisionMinute
public DateField precisionMinute()
-
precisionHour
public DateField precisionHour()
Returns a new DateField, that differs from this DateField by having aprecision
ofhours
. This means, dates stored into the field are constrained to whole hours as represented in GMT (Greenwich Mean Time).NOTE: Some time zones do have an offset to GMT, that is not a whole hour - for instance Indian Standard Time with an offset of 5 hours and 30 minutes. All dates allowed for the field will have a minute part of 30 when being represented in Indian Standard Time.
-
getPrecision
public DateField.Precision getPrecision()
-
roundingMode
public DateField roundingMode(DateField.RoundingMode roundingMode)
- Parameters:
roundingMode
- specifies the rounding mode of the current date if there is a precision constraint on this field. Does not make any difference, if there is no precision constraint.
-
getRoundingMode
public DateField.RoundingMode getRoundingMode()
-
getValueType
public com.exedio.cope.SelectType<Date> getValueType()
-
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<Date>
- Overrides:
getInitialExceptions
in classFunctionField<Date>
-
mapRounded
public SetValue<Date> mapRounded(Date value, DateField.RoundingMode roundingMode)
-
setRounded
public void setRounded(@Nonnull Item item, Date value, @Nonnull DateField.RoundingMode roundingMode)
-
less
public CompareCondition<Date> less(Date 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 less than the given parameter.
-
lessOrEqual
public CompareCondition<Date> lessOrEqual(Date 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 not greater than the given parameter.
-
greater
public CompareCondition<Date> greater(Date 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 greater than the given parameter.
-
greaterOrEqual
public CompareCondition<Date> greaterOrEqual(Date 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 not less than the given parameter.
-
touch
public void touch(@Nonnull Item item)
- Throws:
FinalViolationException
- if this field isfinal
.
-
-