Class DateField

All Implemented Interfaces:
Copyable, Function<Date>, Selectable<Date>, Settable<Date>, Serializable

public final class DateField extends FunctionField<Date>
See Also:
  • Constructor Details

    • DateField

      public DateField()
  • Method Details

    • getDefaultMinimum

      public static Date getDefaultMinimum()
    • getDefaultMaximum

      public static Date getDefaultMaximum()
    • copy

      public DateField copy()
      Specified by:
      copy in class FunctionField<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 class FunctionField<Date>
      See Also:
    • 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 class FunctionField<Date>
      See Also:
    • 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 class FunctionField<Date>
      See Also:
    • nonUnique

      public DateField nonUnique()
      Specified by:
      nonUnique in class FunctionField<Date>
    • copyFrom

      public DateField copyFrom(ItemField<?> copyFrom)
      Specified by:
      copyFrom in class FunctionField<Date>
      See Also:
    • noCopyFrom

      public DateField noCopyFrom()
      Description copied from class: FunctionField
      Returns a new FunctionField that differs from this FunctionField by having no copyFrom fields set.
      Specified by:
      noCopyFrom in class FunctionField<Date>
    • noDefault

      public DateField noDefault()
      Specified by:
      noDefault in class FunctionField<Date>
    • defaultTo

      public DateField defaultTo(Date defaultConstant)
      Specified by:
      defaultTo in class FunctionField<Date>
    • defaultToNow

      public DateField defaultToNow()
    • isDefaultNow

      public boolean isDefaultNow()
    • getMinimum

      public Date getMinimum()
    • getMaximum

      public Date getMaximum()
    • precisionSecond

      public DateField precisionSecond()
      Returns a new DateField, that differs from this DateField by having a precision of seconds. This means, dates stored into the field are constrained to whole seconds.
    • precisionMinute

      public DateField precisionMinute()
      Returns a new DateField, that differs from this DateField by having a precision of minutes. This means, dates stored into the field are constrained to whole minutes.
    • precisionHour

      public DateField precisionHour()
      Returns a new DateField, that differs from this DateField by having a precision of hours. 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 interface Settable<Date>
      Overrides:
      getInitialExceptions in class FunctionField<Date>
    • mapRounded

      public SetValue<Date> mapRounded(Date value, DateField.RoundingMode roundingMode)
    • setRounded

      public void setRounded(@Nonnull Item item, Date value)
    • 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 is final.