cascading.tuple.type

## Class DateType

- java.lang.Object
- - cascading.tuple.type.DateType

All Implemented Interfaces:
  CoercibleType<java.lang.Long>, java.io.Serializable, java.lang.reflect.Type

    public class DateType
    extends java.lang.Object
    implements CoercibleType<java.lang.Long>

Class DateCoercibleType is an implementation of `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.

See Also:
  Serialized Form

### Field Summary

Fields
`protected java.lang.String` `dateFormatString` Field dateFormatString
`protected java.util.Locale` `locale` Field locale
`protected java.util.TimeZone` `zone` Field zone

### Constructor Summary

Constructors
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.

### Method Summary

Methods
`java.lang.Long` `canonical(java.lang.Object value)`
`java.lang.Object` `coerce(java.lang.Object value, java.lang.reflect.Type to)`
`protected java.util.Calendar` `getCalendar()`
`java.lang.Class` `getCanonicalType()`
`java.text.SimpleDateFormat` `getDateFormat()`
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### zone

    protected java.util.TimeZone zone

Field zone

#### locale

    protected java.util.Locale locale

Field locale

#### dateFormatString

    protected java.lang.String dateFormatString

Field dateFormatString

### Constructor Detail

#### DateType

    public DateType(java.lang.String dateFormatString,
            java.util.TimeZone zone,
            java.util.Locale locale)

Create a new DateType instance.

Parameters:
  `dateFormatString` -
  `zone` -
  `locale` -

#### DateType

    public DateType(java.lang.String dateFormatString,
            java.util.TimeZone zone)

#### DateType

    public DateType(java.lang.String dateFormatString)

Create a new DateType instance.

Parameters:
  `dateFormatString` -

### Method Detail

#### getCanonicalType

    public java.lang.Class getCanonicalType()

Specified by:
  `getCanonicalType` in interface `CoercibleType<java.lang.Long>`
Returns:
  the actual Java type this CoercibleType represents

#### getDateFormat

    public java.text.SimpleDateFormat getDateFormat()

#### getCalendar

    protected java.util.Calendar getCalendar()

#### canonical

    public java.lang.Long canonical(java.lang.Object value)

Specified by:
  `canonical` in interface `CoercibleType<java.lang.Long>`
Parameters:
  `value` - of type Object
Returns:
  the value coerced into its canonical type

#### coerce

    public java.lang.Object coerce(java.lang.Object value,
                          java.lang.reflect.Type to)

Specified by:
  `coerce` in interface `CoercibleType<java.lang.Long>`
Parameters:
  `value` - of type Object
  `to` - of type Type
Returns:
  the value coerced into the requested type

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`