public abstract class TypeConverter extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
TypeConverter() |
protected |
TypeConverter(Class... types) |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
decode(Class<?> targetClass,
Object fromDBObject,
MappedField optionalExtraInfo)
decode the
DBObject and provide the corresponding java (type-safe) object
NOTE: optionalExtraInfo might be null |
Object |
decode(Class targetClass,
Object fromDBObject)
decode the
DBObject and provide the corresponding java (type-safe) object |
Object |
encode(Object value)
encode the type safe java object into the corresponding
DBObject |
Object |
encode(Object value,
MappedField optionalExtraInfo)
encode the (type-safe) java object into the corresponding
DBObject |
boolean |
equals(Object obj) |
Mapper |
getMapper() |
Class[] |
getSupportTypes()
Deprecated.
use #getSupportedTypes()
|
int |
hashCode() |
protected boolean |
isSupported(Class<?> c,
MappedField optionalExtraInfo)
checks if the class is supported for this converter.
|
protected boolean |
oneOf(Class f,
Class... classes)
checks if Class f is in classes *
|
protected boolean |
oneOfClasses(Class f,
Class[] classes)
checks if Class f is in classes *
|
void |
setMapper(Mapper mapper) |
void |
setSupportedTypes(Class[] supportedTypes) |
void |
setSupportTypes(Class[] supportTypes)
Deprecated.
use #setSupportedTypes(Class[])
|
protected TypeConverter()
protected TypeConverter(Class... types)
public Mapper getMapper()
@Deprecated public Class[] getSupportTypes()
public void setSupportedTypes(Class[] supportedTypes)
@Deprecated public void setSupportTypes(Class[] supportTypes)
protected boolean isSupported(Class<?> c, MappedField optionalExtraInfo)
public abstract Object decode(Class<?> targetClass, Object fromDBObject, MappedField optionalExtraInfo)
DBObject and provide the corresponding java (type-safe) object
public final Object decode(Class targetClass, Object fromDBObject)
DBObject and provide the corresponding java (type-safe) objectpublic final Object encode(Object value)
DBObjectprotected boolean oneOfClasses(Class f, Class[] classes)
public Object encode(Object value, MappedField optionalExtraInfo)
DBObjectpublic void setMapper(Mapper mapper)