public class DateType extends java.lang.Object implements CoercibleType<java.lang.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 java.lang.String |
dateFormatString
Field dateFormatString
|
protected java.util.Locale |
locale
Field locale
|
protected java.util.TimeZone |
zone
Field zone
|
Constructor and Description |
---|
DateType(java.lang.String dateFormatString)
Create a new DateType instance.
|
DateType(java.lang.String dateFormatString,
java.util.TimeZone zone) |
DateType(java.lang.String dateFormatString,
java.util.TimeZone zone,
java.util.Locale locale)
Create a new DateType instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
canonical(java.lang.Object value) |
java.lang.Object |
coerce(java.lang.Object value,
java.lang.reflect.Type to) |
boolean |
equals(java.lang.Object object) |
protected java.util.Calendar |
getCalendar() |
java.lang.Class |
getCanonicalType() |
java.text.SimpleDateFormat |
getDateFormat() |
int |
hashCode() |
java.lang.String |
toString() |
protected java.util.TimeZone zone
protected java.util.Locale locale
protected java.lang.String dateFormatString
public DateType(java.lang.String dateFormatString, java.util.TimeZone zone, java.util.Locale locale)
dateFormatString
- zone
- locale
- public DateType(java.lang.String dateFormatString, java.util.TimeZone zone)
public DateType(java.lang.String dateFormatString)
dateFormatString
- public java.lang.Class getCanonicalType()
getCanonicalType
in interface CoercibleType<java.lang.Long>
public java.text.SimpleDateFormat getDateFormat()
protected java.util.Calendar getCalendar()
public java.lang.Long canonical(java.lang.Object value)
canonical
in interface CoercibleType<java.lang.Long>
value
- of type Objectpublic java.lang.Object coerce(java.lang.Object value, java.lang.reflect.Type to)
coerce
in interface CoercibleType<java.lang.Long>
value
- of type Objectto
- of type Typepublic boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.