org.databene.commons.converter
Class Date2LongConverter
java.lang.Object
org.databene.commons.converter.AbstractConverter<S,T>
org.databene.commons.converter.ThreadSafeConverter<java.util.Date,java.lang.Long>
org.databene.commons.converter.Date2LongConverter
- All Implemented Interfaces:
- java.lang.Cloneable, Converter<java.util.Date,java.lang.Long>, ThreadAware
public class Date2LongConverter
- extends ThreadSafeConverter<java.util.Date,java.lang.Long>
Converts a Date into the number of milliseconds since 1970-01-01 in a certain time zone and back.
By default it uses the system's default time zone.
Created: 05.08.2007 07:10:25
- Author:
- Volker Bergmann
|
Method Summary |
java.lang.Long |
convert(java.util.Date sourceValue)
Concerts an object of type S to an object of type T |
java.lang.Class<java.lang.Long> |
getTargetType()
|
java.util.TimeZone |
getTimeZone()
|
void |
setTimeZone(java.util.TimeZone timeZone)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Date2LongConverter
public Date2LongConverter()
Date2LongConverter
public Date2LongConverter(java.util.TimeZone timeZone)
getTimeZone
public java.util.TimeZone getTimeZone()
setTimeZone
public void setTimeZone(java.util.TimeZone timeZone)
getTargetType
public java.lang.Class<java.lang.Long> getTargetType()
- Specified by:
getTargetType in interface Converter<java.util.Date,java.lang.Long>- Overrides:
getTargetType in class AbstractConverter<java.util.Date,java.lang.Long>
convert
public java.lang.Long convert(java.util.Date sourceValue)
throws ConversionException
- Description copied from interface:
Converter
- Concerts an object of type S to an object of type T
- Parameters:
sourceValue - the object to convert
- Returns:
- the converted object
- Throws:
ConversionException - if the conversion fails
Copyright © 2010. All Rights Reserved.