public class DateWrapper extends DualWrapper<Date,Long> implements Comparable<DateWrapper>
Date, and the marshalled form is Long. A wrapper is
necessary because date objects are not marshalled correctly under
certain time zones, including GMT.| Constructor and Description |
|---|
DateWrapper()
Creates a new wrapper.
|
DateWrapper(Date date)
Creates a new wrapper for the given date.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DateWrapper other) |
protected void |
toMarshalled()
Sets the marshalled form of the receiver's value so that it
corresponds to its raw form.
|
protected void |
toRaw()
Sets the raw form of the receiver's value so that it
corresponds to its marshalled form.
|
getMarshalled, getRaw, readExternal, setMarshalled, setMarshalledOnly, setRaw, setRawOnly, writeExternalpublic DateWrapper(Date date)
date - The date, which may be null.public DateWrapper()
protected void toRaw()
DualWrapperDualWrapper.setRawOnly(Object) and
DualWrapper.setMarshalledOnly(Object) should be used in
setting either form, to prevent infinite recursion. The raw
form is null if and only if the marshalled one is null; the
caller of this method will enforce this invariant, so the
subclass implementation can set just the raw form to null.toRaw in class DualWrapper<Date,Long>protected void toMarshalled()
DualWrapperDualWrapper.setRawOnly(Object) and
DualWrapper.setMarshalledOnly(Object) should be used in setting
either form, to prevent infinite recursion. The raw form is
null if and only if the marshalled one is null; the caller of
this method will enforce this invariant, so the subclass
implementation can set just the marshalled form to null.toMarshalled in class DualWrapper<Date,Long>public int compareTo(DateWrapper other)
compareTo in interface Comparable<DateWrapper>Copyright © 2015. All Rights Reserved.