org.databene.commons.converter
Class BooleanMapper<T>
java.lang.Object
org.databene.commons.converter.AbstractConverter<S,T>
org.databene.commons.converter.ThreadSafeConverter<java.lang.Boolean,T>
org.databene.commons.converter.BooleanMapper<T>
- All Implemented Interfaces:
- java.lang.Cloneable, Converter<java.lang.Boolean,T>, ThreadAware
public class BooleanMapper<T>
- extends ThreadSafeConverter<java.lang.Boolean,T>
Maps true, false and null to configured aliases, e.g. '1', '0' and '?'.
By default booleans are converted to the strings 'true', 'false' and null.
Created at 11.03.2009 19:40:33
- Since:
- 0.5.8
- Author:
- Volker Bergmann
|
Method Summary |
T |
convert(java.lang.Boolean 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 |
BooleanMapper
public BooleanMapper()
BooleanMapper
public BooleanMapper(T trueValue,
T falseValue,
T nullValue)
convert
public T convert(java.lang.Boolean 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.