org.databene.commons.converter
Class Date2DurationConverter
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.Date2DurationConverter
- All Implemented Interfaces:
- java.lang.Cloneable, Converter<java.util.Date,java.lang.Long>, ThreadAware
public class Date2DurationConverter
- extends ThreadSafeConverter<java.util.Date,java.lang.Long>
Interprets a Date as duration specification, e.g. '0000-00-00T00:00:00.001' as one millisecond,
'0001-00-00T00:00:00.000' as one year. Dates after 1970-01-01 will be interpreted relative to that date.
Created at 11.01.2009 06:39:28
- Since:
- 0.5.7
- 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 |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Date2DurationConverter
public Date2DurationConverter()
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.