Class 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 Detail

      • get

        public T get()
        Specified by:
        get in class MorphiaReference<T>
        returns the referenced entity if it exists. May return null.
      • isResolved

        public boolean isResolved()
        Specified by:
        isResolved in class MorphiaReference<T>
        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 class MorphiaReference<T>
        mapper - the mapper
        value - the value
        optionalExtraInfo - the MappedField
        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
        datastore - the datastore
        mapper - the mapper
        mappedField - the MappedField
        paramType - the type of the underlying entity
        dbObject - the DBObject to decode
        the entity