Package dev.morphia.mapping.codec.pojo
Class TypeData<T>
- java.lang.Object
-
- dev.morphia.mapping.codec.pojo.TypeData<T>
-
- Type Parameters:
T
- the underlying type being represented
- All Implemented Interfaces:
org.bson.codecs.pojo.TypeWithTypeParameters<T>
- Direct Known Subclasses:
WildCardTypeData
public class TypeData<T> extends Object implements org.bson.codecs.pojo.TypeWithTypeParameters<T>
Holds type information about a type element- Since:
- 2.0
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeData.Builder<T>
A builder for TypeData
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> TypeData.Builder<T>
builder(Class<T> type)
Creates a new builder for ClassTypeDataboolean
equals(Object o)
Class<T>
getType()
List<TypeData<?>>
getTypeParameters()
int
hashCode()
static TypeData<?>
newInstance(Field field)
Creates a TypeData reflecting the type of the given field.static <T> TypeData<T>
newInstance(Type genericType, Class<T> clazz)
Creates a TypeData reflecting the given generic type and class.String
toString()
-
-
-
Method Detail
-
builder
public static <T> TypeData.Builder<T> builder(Class<T> type)
Creates a new builder for ClassTypeData- Type Parameters:
T
- the type- Parameters:
type
- the class for the type- Returns:
- the builder
-
newInstance
public static TypeData<?> newInstance(Field field)
Creates a TypeData reflecting the type of the given field.- Parameters:
field
- the field to analyze- Returns:
- the new TypeData information
-
newInstance
public static <T> TypeData<T> newInstance(Type genericType, Class<T> clazz)
Creates a TypeData reflecting the given generic type and class.- Type Parameters:
T
- the type of the new TypeData instance- Parameters:
genericType
- the type to analyzeclazz
- the class to analyze- Returns:
- the new TypeData information
-
getType
public Class<T> getType()
- Specified by:
getType
in interfaceorg.bson.codecs.pojo.TypeWithTypeParameters<T>
- Returns:
- the class this
ClassTypeData
represents
-
getTypeParameters
public List<TypeData<?>> getTypeParameters()
- Specified by:
getTypeParameters
in interfaceorg.bson.codecs.pojo.TypeWithTypeParameters<T>
- Returns:
- the type parameters for the class
-
-