public class TypeVariableTypeInformation<T> extends Object
TypeDiscoverer to determine the actual type for a TypeVariable. Will consider the context the
TypeVariable is being used in.| Constructor and Description |
|---|
TypeVariableTypeInformation(TypeVariable<?> variable,
Type owningType,
io.lettuce.core.dynamic.support.TypeDiscoverer<?> parent,
Map<TypeVariable<?>,Type> typeVariableMap)
Creates a bew
TypeVariableTypeInformation for the given TypeVariable owning Type and parent
TypeDiscoverer. |
| Modifier and Type | Method and Description |
|---|---|
protected TypeInformation<?> |
createInfo(Type fieldType)
Creates
TypeInformation for the given Type. |
protected TypeInformation<?> |
doGetComponentType() |
protected TypeInformation<?> |
doGetMapValueType() |
boolean |
equals(Object obj) |
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
Collections or the key type for Maps. |
Type |
getGenericType() |
TypeInformation<?> |
getMapValueType()
Will return the type of the value in case the underlying type is a
Map. |
List<TypeInformation<?>> |
getParameterTypes(Constructor<?> constructor)
Returns the
TypeInformations for the parameters of the given Constructor. |
List<TypeInformation<?>> |
getParameterTypes(Method method)
Returns the
TypeInformations for the parameters of the given Method. |
ClassTypeInformation<?> |
getRawTypeInformation()
Returns a
ClassTypeInformation to represent the TypeInformation of the raw type of the current instance. |
TypeInformation<?> |
getReturnType(Method method)
Returns a
TypeInformation for the return type of the given Method. |
TypeInformation<?> |
getSuperTypeInformation(Class<?> superType)
Returns the
TypeInformation for the given raw super type. |
Class<T> |
getType()
Returns the type of the property.
|
TypeInformation<?> |
getTypeArgument(Class<?> bound,
int index) |
List<TypeInformation<?>> |
getTypeArguments()
Returns the
TypeInformation for the type arguments of the current TypeInformation. |
Map<TypeVariable<?>,Type> |
getTypeVariableMap()
Returns the type variable map.
|
String |
getVariableName() |
int |
hashCode() |
boolean |
isAssignableFrom(TypeInformation<?> target)
Returns if the current
TypeInformation can be safely assigned to the given one. |
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 Class<S> |
resolveClass(Type type)
Resolves the given type into a plain
Class. |
protected Type |
resolveType(Type type)
Resolves the given type into a
Type. |
String |
toString() |
public TypeVariableTypeInformation(TypeVariable<?> variable, Type owningType, io.lettuce.core.dynamic.support.TypeDiscoverer<?> parent, Map<TypeVariable<?>,Type> typeVariableMap)
TypeVariableTypeInformation for the given TypeVariable owning Type and parent
TypeDiscoverer.variable - must not be nullowningType - must not be nullparent - can be be nulltypeVariableMap - must not be nullpublic Class<T> getType()
TypeInformationgetType in interface TypeInformation<T>public List<TypeInformation<?>> getTypeArguments()
TypeInformationTypeInformation for the type arguments of the current TypeInformation.getTypeArguments in interface TypeInformation<T>public boolean equals(Object obj)
public int hashCode()
public String getVariableName()
protected TypeInformation<?> createInfo(Type fieldType)
TypeInformation for the given Type.public Map<TypeVariable<?>,Type> getTypeVariableMap()
getTypeVariableMap in interface TypeInformation<S>protected Class<S> resolveClass(Type type)
Class.type - protected Type resolveType(Type type)
Type.type - public List<TypeInformation<?>> getParameterTypes(Constructor<?> constructor)
TypeInformationTypeInformations for the parameters of the given Constructor.getParameterTypes in interface TypeInformation<S>constructor - must not be null.public Type getGenericType()
getGenericType in interface TypeInformation<S>public ClassTypeInformation<?> getRawTypeInformation()
TypeInformationClassTypeInformation to represent the TypeInformation of the raw type of the current instance.getRawTypeInformation in interface TypeInformation<S>public TypeInformation<?> getActualType()
TypeInformationMap 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()
TypeInformationMap. 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()
TypeInformationMap.getMapValueType in interface TypeInformation<S>protected TypeInformation<?> doGetMapValueType()
public boolean isCollectionLike()
TypeInformationCollection 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 final TypeInformation<?> getComponentType()
TypeInformationCollections or the key type for Maps.getComponentType in interface TypeInformation<S>protected TypeInformation<?> doGetComponentType()
public TypeInformation<?> getReturnType(Method method)
TypeInformationTypeInformation 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 List<TypeInformation<?>> getParameterTypes(Method method)
TypeInformationTypeInformations for the parameters of the given Method.getParameterTypes in interface TypeInformation<S>method - must not be null.public TypeInformation<?> getSuperTypeInformation(Class<?> superType)
TypeInformationTypeInformation for the given raw super type.getSuperTypeInformation in interface TypeInformation<S>superType - must not be null.TypeInformation for the given raw super type or null in case the current
TypeInformation does not implement the given type.public boolean isAssignableFrom(TypeInformation<?> target)
TypeInformationTypeInformation can be safely assigned to the given one. Mimics semantics of
Class.isAssignableFrom(Class) but takes generics into account. Thus it will allow to detect that a
List<Long> is assignable to List<? extends Number>.isAssignableFrom in interface TypeInformation<S>public TypeInformation<?> getTypeArgument(Class<?> bound, int index)
Copyright © 2020 lettuce.io. All rights reserved.