Package org.springframework.data.util
Class ClassTypeInformation<S>
java.lang.Object
org.springframework.data.util.ClassTypeInformation<S>
- All Implemented Interfaces:
TypeInformation<S>
Deprecated, for removal: This API element is subject to removal in a future version.
TypeInformation
for a plain Class
.- Author:
- Oliver Gierke, Christoph Strobl
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ClassTypeInformation<Collection>
Deprecated, for removal: This API element is subject to removal in a future version.static final ClassTypeInformation<List>
Deprecated, for removal: This API element is subject to removal in a future version.static final ClassTypeInformation<Map>
Deprecated, for removal: This API element is subject to removal in a future version.static final ClassTypeInformation<Object>
Deprecated, for removal: This API element is subject to removal in a future version.static final ClassTypeInformation<Set>
Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeInformation<?>
protected TypeInformation<?>
boolean
static <S> ClassTypeInformation<S>
Deprecated.since 3.0.static <S> TypeInformation<S>
fromReturnTypeOf
(Method method) Deprecated.since 3.0.Transparently returns theMap
value type if the type is aMap
, returns the component type if the typeTypeInformation.isCollectionLike()
or the simple type if none of this applies.Returns the component type forCollection
s or the key type forMap
s.Will return the type of the value in case the underlying type is aMap
.List<TypeInformation<?>>
getParameterTypes
(Constructor<?> constructor) Returns theTypeInformation
s for the parameters of the givenConstructor
.List<TypeInformation<?>>
getParameterTypes
(Method method) Returns theTypeInformation
s for the parameters of the givenMethod
.getProperty
(String name) Returns the property information for the property with the given name.Deprecated, for removal: This API element is subject to removal in a future version.Returns aTypeInformation
to represent theTypeInformation
of the raw type of the current instance.getReturnType
(Method method) Returns aTypeInformation
for the return type of the givenMethod
.getSuperTypeInformation
(Class<?> superType) Returns theTypeInformation
for the given raw super type.getType()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the type of the property.List<TypeInformation<?>>
Returns theTypeInformation
for the type arguments of the currentTypeInformation
.int
hashCode()
boolean
isAssignableFrom
(TypeInformation<?> target) Deprecated, for removal: This API element is subject to removal in a future version.Returns if the currentTypeInformation
can be safely assigned to the given one.boolean
Returns whether the type can be considered a collection, which means it's a container of elements, e.g. aCollection
andArray
or anything implementingIterable
.boolean
isMap()
Returns whether the property is aMap
.TypeInformation<? extends S>
specialize
(TypeInformation<?> type) Deprecated, for removal: This API element is subject to removal in a future version.Specializes the given (raw)TypeInformation
using the context of the current potentially parameterized type, basically turning the given raw type into a parameterized one.toString()
Deprecated, for removal: This API element is subject to removal in a future version.Returns theTypeDescriptor
equivalent of thisTypeInformation
.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.data.util.TypeInformation
getRequiredActualType, getRequiredComponentType, getRequiredMapValueType, getRequiredProperty, getRequiredSuperTypeInformation, getUserTypeInformation, isSubTypeOf
-
Field Details
-
COLLECTION
Deprecated, for removal: This API element is subject to removal in a future version. -
LIST
Deprecated, for removal: This API element is subject to removal in a future version. -
SET
Deprecated, for removal: This API element is subject to removal in a future version. -
MAP
Deprecated, for removal: This API element is subject to removal in a future version. -
OBJECT
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
from
Deprecated.since 3.0. UseTypeInformation.of(org.springframework.core.ResolvableType)
instead.- Type Parameters:
S
-- Parameters:
type
-- Returns:
-
fromReturnTypeOf
Deprecated.since 3.0. UseTypeInformation.fromReturnTypeOf(Method)
instead.Warning: Does not fully resolve generic arguments.- Parameters:
method
-- Returns:
-
getType
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypeInformation
Returns the type of the property. Will resolve generics and the generic context of- Specified by:
getType
in interfaceTypeInformation<S>
- Returns:
-
getRawTypeInformation
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypeInformation
Returns aTypeInformation
to represent theTypeInformation
of the raw type of the current instance.- Specified by:
getRawTypeInformation
in interfaceTypeInformation<S>
- Returns:
-
isAssignableFrom
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypeInformation
Returns if the currentTypeInformation
can be safely assigned to the given one. Mimics semantics ofClass.isAssignableFrom(Class)
but takes generics into account. Thus it will allow to detect that aList<Long>
is assignable toList<? extends Number>
.- Specified by:
isAssignableFrom
in interfaceTypeInformation<S>
- Returns:
-
specialize
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypeInformation
Specializes the given (raw)TypeInformation
using the context of the current potentially parameterized type, basically turning the given raw type into a parameterized one. Will return the given type as is if no generics are involved.- Specified by:
specialize
in interfaceTypeInformation<S>
- Parameters:
type
- must not be null.- Returns:
- will never be null.
-
toString
Deprecated, for removal: This API element is subject to removal in a future version. -
getParameterTypes
Description copied from interface:TypeInformation
Returns theTypeInformation
s for the parameters of the givenConstructor
.- Specified by:
getParameterTypes
in interfaceTypeInformation<S>
- Parameters:
constructor
- must not be null.- Returns:
-
getProperty
Description copied from interface:TypeInformation
Returns the property information for the property with the given name. Supports property traversal through dot notation.- Specified by:
getProperty
in interfaceTypeInformation<S>
- Returns:
-
isCollectionLike
public boolean isCollectionLike()Description copied from interface:TypeInformation
Returns whether the type can be considered a collection, which means it's a container of elements, e.g. aCollection
andArray
or anything implementingIterable
. If this returns true you can expectTypeInformation.getComponentType()
to return a non-null value.- Specified by:
isCollectionLike
in interfaceTypeInformation<S>
- Returns:
-
getComponentType
Description copied from interface:TypeInformation
Returns the component type forCollection
s or the key type forMap
s.- Specified by:
getComponentType
in interfaceTypeInformation<S>
- Returns:
-
doGetComponentType
-
isMap
public boolean isMap()Description copied from interface:TypeInformation
Returns whether the property is aMap
. If this returns true you can expectTypeInformation.getComponentType()
as well asTypeInformation.getMapValueType()
to return something not null.- Specified by:
isMap
in interfaceTypeInformation<S>
- Returns:
-
getMapValueType
Description copied from interface:TypeInformation
Will return the type of the value in case the underlying type is aMap
.- Specified by:
getMapValueType
in interfaceTypeInformation<S>
- Returns:
-
doGetMapValueType
-
toTypeDescriptor
Description copied from interface:TypeInformation
Returns theTypeDescriptor
equivalent of thisTypeInformation
.- Specified by:
toTypeDescriptor
in interfaceTypeInformation<S>
- Returns:
- will never be null.
-
getActualType
Description copied from interface:TypeInformation
Transparently returns theMap
value type if the type is aMap
, returns the component type if the typeTypeInformation.isCollectionLike()
or the simple type if none of this applies.- Specified by:
getActualType
in interfaceTypeInformation<S>
- Returns:
- the map value, collection component type or the current type, null it the current type is a raw
Map
orCollection
.
-
getReturnType
Description copied from interface:TypeInformation
Returns aTypeInformation
for the return type of the givenMethod
. Will potentially resolve generics information against the current types type parameter bindings.- Specified by:
getReturnType
in interfaceTypeInformation<S>
- Parameters:
method
- must not be null.- Returns:
-
getParameterTypes
Description copied from interface:TypeInformation
Returns theTypeInformation
s for the parameters of the givenMethod
.- Specified by:
getParameterTypes
in interfaceTypeInformation<S>
- Parameters:
method
- must not be null.- Returns:
-
getSuperTypeInformation
Description copied from interface:TypeInformation
Returns theTypeInformation
for the given raw super type.- Specified by:
getSuperTypeInformation
in interfaceTypeInformation<S>
- Parameters:
superType
- must not be null.- Returns:
- the
TypeInformation
for the given raw super type or null in case the currentTypeInformation
does not implement the given type.
-
getTypeArguments
Description copied from interface:TypeInformation
Returns theTypeInformation
for the type arguments of the currentTypeInformation
.- Specified by:
getTypeArguments
in interfaceTypeInformation<S>
- Returns:
-
equals
-
hashCode
public int hashCode()
-
TypeInformation
only.