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
FieldsModifier 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<?>booleanstatic <S> ClassTypeInformation<S>Deprecated.since 3.0.static <S> TypeInformation<S>fromReturnTypeOf(Method method) Deprecated.since 3.0.Transparently returns theMapvalue 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 forCollections or the key type forMaps.Will return the type of the value in case the underlying type is aMap.List<TypeInformation<?>>getParameterTypes(Constructor<?> constructor) Returns theTypeInformations for the parameters of the givenConstructor.List<TypeInformation<?>>getParameterTypes(Method method) Returns theTypeInformations 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 aTypeInformationto represent theTypeInformationof the raw type of the current instance.getReturnType(Method method) Returns aTypeInformationfor the return type of the givenMethod.getSuperTypeInformation(Class<?> superType) Returns theTypeInformationfor 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 theTypeInformationfor the type arguments of the currentTypeInformation.inthashCode()booleanisAssignableFrom(TypeInformation<?> target) Deprecated, for removal: This API element is subject to removal in a future version.Returns if the currentTypeInformationcan be safely assigned to the given one.booleanReturns whether the type can be considered a collection, which means it's a container of elements, e.g. aCollectionandArrayor anything implementingIterable.booleanisMap()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)TypeInformationusing 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 theTypeDescriptorequivalent of thisTypeInformation.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:TypeInformationReturns the type of the property. Will resolve generics and the generic context of- Specified by:
getTypein interfaceTypeInformation<S>- Returns:
-
getRawTypeInformation
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypeInformationReturns aTypeInformationto represent theTypeInformationof the raw type of the current instance.- Specified by:
getRawTypeInformationin interfaceTypeInformation<S>- Returns:
-
isAssignableFrom
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypeInformationReturns if the currentTypeInformationcan 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:
isAssignableFromin interfaceTypeInformation<S>- Returns:
-
specialize
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TypeInformationSpecializes the given (raw)TypeInformationusing 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:
specializein 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:TypeInformationReturns theTypeInformations for the parameters of the givenConstructor.- Specified by:
getParameterTypesin interfaceTypeInformation<S>- Parameters:
constructor- must not be null.- Returns:
-
getProperty
Description copied from interface:TypeInformationReturns the property information for the property with the given name. Supports property traversal through dot notation.- Specified by:
getPropertyin interfaceTypeInformation<S>- Returns:
-
isCollectionLike
public boolean isCollectionLike()Description copied from interface:TypeInformationReturns whether the type can be considered a collection, which means it's a container of elements, e.g. aCollectionandArrayor anything implementingIterable. If this returns true you can expectTypeInformation.getComponentType()to return a non-null value.- Specified by:
isCollectionLikein interfaceTypeInformation<S>- Returns:
-
getComponentType
Description copied from interface:TypeInformationReturns the component type forCollections or the key type forMaps.- Specified by:
getComponentTypein interfaceTypeInformation<S>- Returns:
-
doGetComponentType
-
isMap
public boolean isMap()Description copied from interface:TypeInformationReturns whether the property is aMap. If this returns true you can expectTypeInformation.getComponentType()as well asTypeInformation.getMapValueType()to return something not null.- Specified by:
isMapin interfaceTypeInformation<S>- Returns:
-
getMapValueType
Description copied from interface:TypeInformationWill return the type of the value in case the underlying type is aMap.- Specified by:
getMapValueTypein interfaceTypeInformation<S>- Returns:
-
doGetMapValueType
-
toTypeDescriptor
Description copied from interface:TypeInformationReturns theTypeDescriptorequivalent of thisTypeInformation.- Specified by:
toTypeDescriptorin interfaceTypeInformation<S>- Returns:
- will never be null.
-
getActualType
Description copied from interface:TypeInformationTransparently returns theMapvalue 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:
getActualTypein interfaceTypeInformation<S>- Returns:
- the map value, collection component type or the current type, null it the current type is a raw
MaporCollection.
-
getReturnType
Description copied from interface:TypeInformationReturns aTypeInformationfor the return type of the givenMethod. Will potentially resolve generics information against the current types type parameter bindings.- Specified by:
getReturnTypein interfaceTypeInformation<S>- Parameters:
method- must not be null.- Returns:
-
getParameterTypes
Description copied from interface:TypeInformationReturns theTypeInformations for the parameters of the givenMethod.- Specified by:
getParameterTypesin interfaceTypeInformation<S>- Parameters:
method- must not be null.- Returns:
-
getSuperTypeInformation
Description copied from interface:TypeInformationReturns theTypeInformationfor the given raw super type.- Specified by:
getSuperTypeInformationin interfaceTypeInformation<S>- Parameters:
superType- must not be null.- Returns:
- the
TypeInformationfor the given raw super type or null in case the currentTypeInformationdoes not implement the given type.
-
getTypeArguments
Description copied from interface:TypeInformationReturns theTypeInformationfor the type arguments of the currentTypeInformation.- Specified by:
getTypeArgumentsin interfaceTypeInformation<S>- Returns:
-
equals
-
hashCode
public int hashCode()
-
TypeInformationonly.