Package dev.morphia.mapping.experimental
Class SingleReference<T>
- java.lang.Object
-
- dev.morphia.mapping.experimental.MorphiaReference<T>
-
- dev.morphia.mapping.experimental.SingleReference<T>
-
- Type Parameters:
T
-
public class SingleReference<T> extends MorphiaReference<T>
Developer note. This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MorphiaReference<?>
decode(Datastore datastore, Mapper mapper, MappedField mappedField, java.lang.Class paramType, com.mongodb.DBObject dbObject)
Decodes a document in to an entityjava.lang.Object
encode(Mapper mapper, java.lang.Object value, MappedField optionalExtraInfo)
T
get()
boolean
isResolved()
-
Methods inherited from class dev.morphia.mapping.experimental.MorphiaReference
wrap
-
-
-
-
Method Detail
-
get
public T get()
- Specified by:
get
in classMorphiaReference<T>
- Returns:
- returns the referenced entity if it exists. May return null.
-
isResolved
public boolean isResolved()
- Specified by:
isResolved
in classMorphiaReference<T>
- Returns:
- true if this reference has already been resolved
-
encode
public java.lang.Object encode(Mapper mapper, java.lang.Object value, MappedField optionalExtraInfo)
- Specified by:
encode
in classMorphiaReference<T>
- Parameters:
mapper
- the mappervalue
- the valueoptionalExtraInfo
- the MappedField- Returns:
- the encoded vale
-
decode
public static MorphiaReference<?> decode(Datastore datastore, Mapper mapper, MappedField mappedField, java.lang.Class paramType, com.mongodb.DBObject dbObject)
Decodes a document in to an entity- Parameters:
datastore
- the datastoremapper
- the mappermappedField
- the MappedFieldparamType
- the type of the underlying entitydbObject
- the DBObject to decode- Returns:
- the entity
-
-