Package dev.morphia.converters
Class SerializedObjectConverter
- java.lang.Object
-
- dev.morphia.converters.TypeConverter
-
- dev.morphia.converters.SerializedObjectConverter
-
public class SerializedObjectConverter extends TypeConverter
- Author:
- Uwe Schaefer, (us@thomas-daily.de)
-
-
Constructor Summary
Constructors Constructor Description SerializedObjectConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
decode(java.lang.Class targetClass, java.lang.Object fromDBObject, MappedField f)
decode theDBObject
and provide the corresponding java (type-safe) object
NOTE: optionalExtraInfo might be nulljava.lang.Object
encode(java.lang.Object value, MappedField f)
encode the (type-safe) java object into the correspondingDBObject
protected boolean
isSupported(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, 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 f)
Description copied from class:TypeConverter
decode theDBObject
and provide the corresponding java (type-safe) object
NOTE: optionalExtraInfo might be null- Specified by:
decode
in classTypeConverter
- Parameters:
targetClass
- the class to create and populatefromDBObject
- the DBObject to use when populating the new instancef
- the MappedField that contains the metadata useful for decoding- Returns:
- the new instance
-
encode
public java.lang.Object encode(java.lang.Object value, MappedField f)
Description copied from class:TypeConverter
encode the (type-safe) java object into the correspondingDBObject
- Overrides:
encode
in classTypeConverter
- Parameters:
value
- The object to encodef
- the MappedField that contains the metadata useful for decoding- Returns:
- the encoded version of the object
-
isSupported
protected boolean isSupported(java.lang.Class c, MappedField optionalExtraInfo)
Description copied from class:TypeConverter
checks if the class is supported for this converter.- Overrides:
isSupported
in classTypeConverter
-
-