Package dev.morphia.converters
Class IdentityConverter
- java.lang.Object
-
- dev.morphia.converters.TypeConverter
-
- dev.morphia.converters.IdentityConverter
-
public class IdentityConverter extends TypeConverter
- Author:
- Uwe Schaefer, (us@thomas-daily.de), scotthernandez
-
-
Constructor Summary
Constructors Constructor Description IdentityConverter(java.lang.Class... types)Creates the Converter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdecode(java.lang.Class targetClass, java.lang.Object fromDBObject, MappedField optionalExtraInfo)decode theDBObjectand provide the corresponding java (type-safe) object
NOTE: optionalExtraInfo might be nullprotected booleanisSupported(java.lang.Class c, MappedField optionalExtraInfo)checks if the class is supported for this converter.-
Methods inherited from class dev.morphia.converters.TypeConverter
decode, encode, encode, equals, getMapper, getSupportTypes, hashCode, oneOf, oneOfClasses, setMapper, setSupportedTypes, setSupportTypes
-
-
-
-
Method Detail
-
decode
public java.lang.Object decode(java.lang.Class targetClass, java.lang.Object fromDBObject, MappedField optionalExtraInfo)Description copied from class:TypeConverterdecode theDBObjectand provide the corresponding java (type-safe) object
NOTE: optionalExtraInfo might be null- Specified by:
decodein classTypeConverter- Parameters:
targetClass- the class to create and populatefromDBObject- the DBObject to use when populating the new instanceoptionalExtraInfo- the MappedField that contains the metadata useful for decoding- Returns:
- the new instance
-
isSupported
protected boolean isSupported(java.lang.Class c, MappedField optionalExtraInfo)Description copied from class:TypeConverterchecks if the class is supported for this converter.- Overrides:
isSupportedin classTypeConverter
-
-