|
Spring Data Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.util.ClassTypeInformation<S>
public class ClassTypeInformation<S>
TypeInformation
for a plain Class
.
Field Summary | |
---|---|
static TypeInformation<java.util.Collection> |
COLLECTION
|
static TypeInformation<java.util.List> |
LIST
|
static TypeInformation<java.util.Map> |
MAP
|
static TypeInformation<java.lang.Object> |
OBJECT
|
static TypeInformation<java.util.Set> |
SET
|
Constructor Summary | |
---|---|
ClassTypeInformation(java.lang.Class<S> type)
Creates ClassTypeInformation for the given type. |
Method Summary | ||
---|---|---|
protected TypeInformation<?> |
createInfo(java.lang.reflect.Type fieldType)
Creates TypeInformation for the given Type . |
|
boolean |
equals(java.lang.Object obj)
|
|
static
|
from(java.lang.Class<S> type)
Simple factory method to easily create new instances of ClassTypeInformation . |
|
static
|
fromReturnTypeOf(java.lang.reflect.Method method)
Creates a TypeInformation from the given method's return type. |
|
TypeInformation<?> |
getActualType()
Transparently returns the Map value type if the type is a Map , returns the
component type if the type TypeInformation.isCollectionLike() or the simple type if none of this applies. |
|
TypeInformation<?> |
getComponentType()
Returns the component type for Collection s or the key type for Map s. |
|
TypeInformation<?> |
getMapValueType()
Will return the type of the value in case the underlying type is a Map . |
|
java.util.List<TypeInformation<?>> |
getParameterTypes(java.lang.reflect.Constructor<?> constructor)
|
|
TypeInformation<?> |
getProperty(java.lang.String fieldname)
Returns the property information for the property with the given name. |
|
TypeInformation<?> |
getReturnType(java.lang.reflect.Method method)
Returns a TypeInformation for the return type of the given Method . |
|
java.lang.Class<S> |
getType()
Returns the type of the property. |
|
protected java.util.Map<java.lang.reflect.TypeVariable,java.lang.reflect.Type> |
getTypeVariableMap()
Returns the type variable map. |
|
int |
hashCode()
|
|
boolean |
isCollectionLike()
Returns whether the type can be considered a collection, which means it's a container of elements, e.g. a Collection and Array or anything implementing Iterable . |
|
boolean |
isMap()
Returns whether the property is a Map . |
|
protected java.lang.Class<S> |
resolveType(java.lang.reflect.Type type)
Resolves the given type into a plain Class . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final TypeInformation<java.util.Collection> COLLECTION
public static final TypeInformation<java.util.List> LIST
public static final TypeInformation<java.util.Set> SET
public static final TypeInformation<java.util.Map> MAP
public static final TypeInformation<java.lang.Object> OBJECT
Constructor Detail |
---|
public ClassTypeInformation(java.lang.Class<S> type)
ClassTypeInformation
for the given type.
type
- Method Detail |
---|
public static <S> TypeInformation<S> from(java.lang.Class<S> type)
ClassTypeInformation
.
S
- type
-
public static <S> TypeInformation<S> fromReturnTypeOf(java.lang.reflect.Method method)
TypeInformation
from the given method's return type.
method
-
public java.lang.Class<S> getType()
TypeInformation
getType
in interface TypeInformation<S>
public TypeInformation<?> getComponentType()
TypeInformation
Collection
s or the key type for Map
s.
getComponentType
in interface TypeInformation<S>
protected java.util.Map<java.lang.reflect.TypeVariable,java.lang.reflect.Type> getTypeVariableMap()
protected TypeInformation<?> createInfo(java.lang.reflect.Type fieldType)
TypeInformation
for the given Type
.
fieldType
-
protected java.lang.Class<S> resolveType(java.lang.reflect.Type type)
Class
.
type
-
public java.util.List<TypeInformation<?>> getParameterTypes(java.lang.reflect.Constructor<?> constructor)
getParameterTypes
in interface TypeInformation<S>
public TypeInformation<?> getProperty(java.lang.String fieldname)
TypeInformation
getProperty
in interface TypeInformation<S>
public TypeInformation<?> getActualType()
TypeInformation
Map
value type if the type is a Map
, returns the
component type if the type TypeInformation.isCollectionLike()
or the simple type if none of this applies.
getActualType
in interface TypeInformation<S>
public boolean isMap()
TypeInformation
Map
. If this returns true you can expect
TypeInformation.getComponentType()
as well as TypeInformation.getMapValueType()
to return something not null.
isMap
in interface TypeInformation<S>
public TypeInformation<?> getMapValueType()
TypeInformation
Map
.
getMapValueType
in interface TypeInformation<S>
public boolean isCollectionLike()
TypeInformation
Collection
and Array
or anything implementing Iterable
. If this
returns true you can expect TypeInformation.getComponentType()
to return a non-null value.
isCollectionLike
in interface TypeInformation<S>
public TypeInformation<?> getReturnType(java.lang.reflect.Method method)
TypeInformation
TypeInformation
for the return type of the given Method
. Will potentially resolve
generics information against the current types type parameter bindings.
getReturnType
in interface TypeInformation<S>
method
- must not be null.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
Spring Data Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |