Class ImmutableDate

java.lang.Object
java.util.Date
org.restlet.engine.util.ImmutableDate
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public final class ImmutableDate extends Date
Class acting as an immutable date class based on the Date class. Throws UnsupportedOperationException when mutable methods are invoked.
Author:
Piyush Purang (ppurang@gmail.com)
See Also:
  • Constructor Details

    • ImmutableDate

      public ImmutableDate(Date date)
      Private constructor. A factory method is provided.
      Parameters:
      date - date to be made immutable
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class Date
    • setDate

      public void setDate(int arg0)
      As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
      Overrides:
      setDate in class Date
    • setHours

      public void setHours(int arg0)
      As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
      Overrides:
      setHours in class Date
    • setMinutes

      public void setMinutes(int arg0)
      As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
      Overrides:
      setMinutes in class Date
    • setMonth

      public void setMonth(int arg0)
      As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
      Overrides:
      setMonth in class Date
    • setSeconds

      public void setSeconds(int arg0)
      As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
      Overrides:
      setSeconds in class Date
    • setTime

      public void setTime(long arg0)
      As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
      Overrides:
      setTime in class Date
    • setYear

      public void setYear(int arg0)
      As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
      Overrides:
      setYear in class Date