public class DateType extends Object implements CoercibleType<Long>
CoercibleType
.
Given a dateFormatString
, using the SimpleDateFormat
format, this CoercibleType
will convert a value from the formatted string to a Long
canonical type and back.
This class when presented with a Long timestamp value will assume the value is in UTC.
See DateParser
and DateFormatter
for similar
Operations for use within a pipe assembly.Modifier and Type | Field and Description |
---|---|
protected String |
dateFormatString
Field dateFormatString
|
protected Locale |
locale
Field locale
|
protected TimeZone |
zone
Field zone
|
Constructor and Description |
---|
DateType(String dateFormatString)
Create a new DateType instance.
|
DateType(String dateFormatString,
TimeZone zone) |
DateType(String dateFormatString,
TimeZone zone,
Locale locale)
Create a new DateType instance.
|
Modifier and Type | Method and Description |
---|---|
Long |
canonical(Object value) |
Object |
coerce(Object value,
Type to) |
protected Calendar |
getCalendar() |
Class |
getCanonicalType() |
SimpleDateFormat |
getDateFormat() |
String |
toString() |
protected String dateFormatString
public DateType(String dateFormatString, TimeZone zone, Locale locale)
dateFormatString
- zone
- locale
- public Class getCanonicalType()
getCanonicalType
in interface CoercibleType<Long>
public SimpleDateFormat getDateFormat()
protected Calendar getCalendar()
public Long canonical(Object value)
canonical
in interface CoercibleType<Long>
value
- of type Objectpublic Object coerce(Object value, Type to)
coerce
in interface CoercibleType<Long>
value
- of type Objectto
- of type TypeCopyright © 2007-2015 Concurrent, Inc. All Rights Reserved.