Class AtomDate

  • All Implemented Interfaces:
    Serializable, Cloneable

    @Deprecated(since="2021-07-29")
    public final class AtomDate
    extends Object
    implements Cloneable, Serializable
    Deprecated.
    This API is deprecated as Apache Abdera is a retired project since 2017.

    Provides an implementation of the Atom Date Construct, which is itself a specialization of the RFC3339 date-time.

    Accessors on this class are not synchronized.

    Per RFC4287:

       3.3.  Date Constructs
    
       A Date construct is an element whose content MUST conform to the
       "date-time" production in [RFC3339].  In addition, an uppercase "T"
       character MUST be used to separate date and time, and an uppercase
       "Z" character MUST be present in the absence of a numeric time zone
       offset.
    
       atomDateConstruct =
          atomCommonAttributes,
          xsd:dateTime
    
       Such date values happen to be compatible with the following
       specifications: [ISO.8601.1988], [W3C.NOTE-datetime-19980827], and
       [W3C.REC-xmlschema-2-20041028].
    
       Example Date constructs:
    
       <updated>2003-12-13T18:30:02Z</updated>
       <updated>2003-12-13T18:30:02.25Z</updated>
       <updated>2003-12-13T18:30:02+01:00</updated>
       <updated>2003-12-13T18:30:02.25+01:00</updated>
    
       Date values SHOULD be as accurate as possible.  For example, it would
       be generally inappropriate for a publishing system to apply the same
       timestamp to several entries that were published during the course of
       a single day.
      
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomDate()
      Deprecated.
      Create an AtomDate using the current date and time
      AtomDate​(long value)
      Deprecated.
      Create an AtomDate using the number of milliseconds since January 1, 1970, 00:00:00 GMT
      AtomDate​(String value)
      Deprecated.
      Create an AtomDate using the serialized string format (e.g.
      AtomDate​(Calendar value)
      Deprecated.
      Create an AtomDate using a java.util.Calendar.
      AtomDate​(Date value)
      Deprecated.
      Create an AtomDate using a java.util.Date
    • Constructor Detail

      • AtomDate

        public AtomDate()
        Deprecated.
        Create an AtomDate using the current date and time
      • AtomDate

        public AtomDate​(String value)
        Deprecated.
        Create an AtomDate using the serialized string format (e.g. 2003-12-13T18:30:02Z).
        Parameters:
        value - The serialized RFC3339 date/time value
      • AtomDate

        public AtomDate​(Date value)
        Deprecated.
        Create an AtomDate using a java.util.Date
        Parameters:
        value - The java.util.Date value
        Throws:
        NullPointerException - if date is null
      • AtomDate

        public AtomDate​(Calendar value)
        Deprecated.
        Create an AtomDate using a java.util.Calendar.
        Parameters:
        value - The java.util.Calendar value
        Throws:
        NullPointerException - if value is null
      • AtomDate

        public AtomDate​(long value)
        Deprecated.
        Create an AtomDate using the number of milliseconds since January 1, 1970, 00:00:00 GMT
        Parameters:
        value - The number of milliseconds since January 1, 1970, 00:00:00 GMT
    • Method Detail

      • getValue

        public String getValue()
        Deprecated.
        Return the serialized string form of the Atom date
        Returns:
        the serialized string form of the date as specified by RFC4287
      • setValue

        public AtomDate setValue​(String value)
        Deprecated.
        Sets the value of the Atom date using the serialized string form
        Parameters:
        value - The serialized string form of the date
      • setValue

        public AtomDate setValue​(Date date)
        Deprecated.
        Sets the value of the Atom date using java.util.Date
        Parameters:
        date - A java.util.Date
        Throws:
        NullPointerException - if date is null
      • setValue

        public AtomDate setValue​(Calendar calendar)
        Deprecated.
        Sets the value of the Atom date using java.util.Calendar
        Parameters:
        calendar - a java.util.Calendar
      • setValue

        public AtomDate setValue​(long timestamp)
        Deprecated.
        Sets the value of the Atom date using the number of milliseconds since January 1, 1970, 00:00:00 GMT
        Parameters:
        timestamp - The number of milliseconds since January 1, 1970, 00:00:00 GMT
      • getDate

        public Date getDate()
        Deprecated.
        Returns the value of this Atom Date
        Returns:
        A java.util.Date representing this Atom Date
      • getCalendar

        public Calendar getCalendar()
        Deprecated.
        Returns the value of this Atom Date as a java.util.Calendar
        Returns:
        A java.util.Calendar representing this Atom Date
      • getTime

        public long getTime()
        Deprecated.
        Returns the value of this Atom Date as the number of milliseconds since January 1, 1970, 00:00:00 GMT
        Returns:
        The number of milliseconds since January 1, 1970, 00:00:00 GMT
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Deprecated.
        Overrides:
        equals in class Object
      • clone

        public Object clone()
        Deprecated.
      • parse

        public static Date parse​(String date)
        Deprecated.
        Parse the serialized string form into a java.util.Date
        Parameters:
        date - The serialized string form of the date
        Returns:
        The created java.util.Date
      • format

        public static String format​(Date date)
        Deprecated.
        Create the serialized string form from a java.util.Date
        Parameters:
        d - A java.util.Date
        Returns:
        The serialized string form of the date
      • valueOf

        public static AtomDate valueOf​(String value)
        Deprecated.
        Create a new Atom Date instance from the serialized string form
        Parameters:
        value - The serialized string form of the date
        Returns:
        The created AtomDate
      • valueOf

        public static AtomDate valueOf​(Date value)
        Deprecated.
        Create a new Atom Date instance from a java.util.Date
        Parameters:
        value - a java.util.Date
        Returns:
        The created AtomDate
      • valueOf

        public static AtomDate valueOf​(Calendar value)
        Deprecated.
        Create a new Atom Date instance from a java.util.Calendar
        Parameters:
        value - A java.util.Calendar
        Returns:
        The created AtomDate
      • valueOf

        public static AtomDate valueOf​(long value)
        Deprecated.
        Create a new Atom Date instance using the number of milliseconds since January 1, 1970, 00:00:00 GMT
        Parameters:
        value - The number of milliseconds since January 1, 1970, 00:00:00 GMT
        Returns:
        The created AtomDate