@ SuppressWarnings ( "unchecked" ) public static < V > MorphiaReference < V > wrap ( final V value ) { if ( value instanceof List ) { return ( MorphiaReference < V > ) new ListReference < V > ( ( List < V > ) value ) ; } else if ( value instanceof Set ) { return ( MorphiaReference < V > ) new SetReference < V > ( ( Set < V > ) value ) ; } else if ( value instanceof Map ) { return ( MorphiaReference < V > ) new MapReference < V > ( ( Map < String , V > ) value ) ; } else { return new SingleReference < V > ( value ) ; } }
Wraps an value in a MorphiaReference to storing on an entity