Package dev.morphia.converters
Class URIConverter
- java.lang.Object
-
- dev.morphia.converters.TypeConverter
-
- dev.morphia.converters.URIConverter
-
- All Implemented Interfaces:
SimpleValueConverter
public class URIConverter extends TypeConverter implements SimpleValueConverter
- Author:
- scotthernandez
-
-
Constructor Summary
Constructors Modifier Constructor Description URIConverter()
Creates the Converter.protected
URIConverter(java.lang.Class clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
decode(java.lang.Class targetClass, java.lang.Object val, MappedField optionalExtraInfo)
decode theDBObject
and provide the corresponding java (type-safe) object
NOTE: optionalExtraInfo might be nulljava.lang.String
encode(java.lang.Object uri, MappedField optionalExtraInfo)
encode the (type-safe) java object into the correspondingDBObject
-
Methods inherited from class dev.morphia.converters.TypeConverter
decode, encode, equals, getMapper, getSupportTypes, hashCode, isSupported, oneOf, oneOfClasses, setMapper, setSupportedTypes, setSupportTypes
-
-
-
-
Method Detail
-
decode
public java.lang.Object decode(java.lang.Class targetClass, java.lang.Object val, MappedField optionalExtraInfo)
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 populateval
- the DBObject to use when populating the new instanceoptionalExtraInfo
- the MappedField that contains the metadata useful for decoding- Returns:
- the new instance
-
encode
public java.lang.String encode(java.lang.Object uri, MappedField optionalExtraInfo)
Description copied from class:TypeConverter
encode the (type-safe) java object into the correspondingDBObject
- Overrides:
encode
in classTypeConverter
- Parameters:
uri
- The object to encodeoptionalExtraInfo
- the MappedField that contains the metadata useful for decoding- Returns:
- the encoded version of the object
-
-