Class DateProperty<T extends Temporal>

  • All Implemented Interfaces:
    Serializable, Comparable<Property>
    Direct Known Subclasses:
    Acknowledged, Completed, Created, DtEnd, DtStamp, DtStart, Due, LastModified, RecurrenceId, Trigger

    public abstract class DateProperty<T extends Temporal>
    extends Property

    Created on 9/07/2005

    Base class for properties with a DATE or DATE-TIME value. Note that some sub-classes may only allow either a DATE or a DATE-TIME value, for which additional rules/validation should be specified. Note that generics have been introduced as part of the migration to the new Java Date/Time API. Date properties should now indicate the applicable Temporal type for the property. For example:

    • UTC-based properties should use Instant to represent UTC time
    • Date-only properties should use LocalDate to represent a date value
    • Date-time properties should use ZonedDateTime to represent a date-time value influenced by timezone rules
    See Also:
    Serialized Form
    • Constructor Detail

      • DateProperty

        public DateProperty​(String name,
                            ParameterList parameters)
        name - the property name
        parameters - a list of initial parameters
      • DateProperty

        public DateProperty​(String name)
        name - the property name
    • Method Detail

      • getDate

        public T getDate()
        This method will attempt to dynamically cast the internal Temporal value to the required return value. e.g. LocalDate localDate = dateProperty.getDate();
        Returns the date.
      • setDate

        public void setDate​(T date)
        Sets the date value of this property. The timezone and value of this instance will also be updated accordingly.
        date - The date to set.
      • getValue

        public String getValue()
        Specified by:
        getValue in class Content
        the content value
      • setTimeZoneRegistry

        public void setTimeZoneRegistry​(TimeZoneRegistry timeZoneRegistry)
      • isUtc

        public final boolean isUtc()
        Indicates whether the current date value is specified in UTC time.
        true if the property is in UTC time, otherwise false