Package org.restlet.engine.util
Class ImmutableDate
java.lang.Object
java.util.Date
org.restlet.engine.util.ImmutableDate
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()voidsetDate(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.voidsetHours(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.voidsetMinutes(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.voidsetMonth(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.voidsetSeconds(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.voidsetTime(long arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.voidsetYear(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.Methods inherited from class java.util.Date
after, before, compareTo, equals, from, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, toGMTString, toInstant, toLocaleString, toString, UTC
-
Constructor Details
-
ImmutableDate
Private constructor. A factory method is provided.- Parameters:
date- date to be made immutable
-
-
Method Details
-
clone
-
setDate
public void setDate(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception. -
setHours
public void setHours(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception. -
setMinutes
public void setMinutes(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.- Overrides:
setMinutesin classDate
-
setMonth
public void setMonth(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception. -
setSeconds
public void setSeconds(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.- Overrides:
setSecondsin classDate
-
setTime
public void setTime(long arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception. -
setYear
public void setYear(int arg0) As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
-