Class DateWrapper
- java.lang.Object
-
- org.marketcetera.util.ws.wrappers.BaseWrapper<R>
-
- org.marketcetera.util.ws.wrappers.DualWrapper<Date,Long>
-
- org.marketcetera.util.ws.wrappers.DateWrapper
-
- All Implemented Interfaces:
Externalizable,Serializable,Comparable<DateWrapper>
public class DateWrapper extends DualWrapper<Date,Long> implements Comparable<DateWrapper>
A dual-form wrapper for marshalling a date. The raw form isDate, and the marshalled form isLong. A wrapper is necessary because date objects are not marshalled correctly under certain time zones, including GMT.- Since:
- 1.5.0
- Version:
- $Id: DateWrapper.java 16154 2012-07-14 16:34:05Z colin $
- Author:
- tlerios@marketcetera.com
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description DateWrapper()Creates a new wrapper.DateWrapper(Date date)Creates a new wrapper for the given date.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(DateWrapper other)protected voidtoMarshalled()Sets the marshalled form of the receiver's value so that it corresponds to its raw form.protected voidtoRaw()Sets the raw form of the receiver's value so that it corresponds to its marshalled form.-
Methods inherited from class org.marketcetera.util.ws.wrappers.DualWrapper
getMarshalled, getRaw, readExternal, setMarshalled, setMarshalledOnly, setRaw, setRawOnly, writeExternal
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DateWrapper
public DateWrapper(Date date)
Creates a new wrapper for the given date.- Parameters:
date- The date, which may be null.
-
DateWrapper
public DateWrapper()
Creates a new wrapper. This empty constructor is intended for use by JAXB and Java serialization.
-
-
Method Detail
-
toRaw
protected void toRaw()
Description copied from class:DualWrapperSets the raw form of the receiver's value so that it corresponds to its marshalled form. The subclass implementation can assume that the latter form is non-null. The subclass may modify both the former and latter forms (for example, if the latter form is invalid). OnlyDualWrapper.setRawOnly(Object)andDualWrapper.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.- Specified by:
toRawin classDualWrapper<Date,Long>
-
toMarshalled
protected void toMarshalled()
Description copied from class:DualWrapperSets the marshalled form of the receiver's value so that it corresponds to its raw form. The subclass implementation can assume that the latter form is non-null. The subclass may modify both the former and latter forms (for example, if the latter form is invalid). OnlyDualWrapper.setRawOnly(Object)andDualWrapper.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.- Specified by:
toMarshalledin classDualWrapper<Date,Long>
-
compareTo
public int compareTo(DateWrapper other)
- Specified by:
compareToin interfaceComparable<DateWrapper>
-
-