public interface TypeInformation<S>
ClassTypeInformation
you can travers properties using getProperty(String) to access type information.| Modifier and Type | Method and Description |
|---|---|
TypeInformation<?> |
getActualType()
Transparently returns the
Map value type if the type is a Map, returns the
component type if the type isCollectionLike() or the simple type if none of this applies. |
TypeInformation<?> |
getComponentType()
Returns the component type for
Collections or the key type for Maps. |
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. |
TypeInformation<?> |
getProperty(String fieldname)
Returns the property information for the property with the given name.
|
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<S> |
getType()
Returns the type of the property.
|
List<TypeInformation<?>> |
getTypeArguments()
Returns the
TypeInformation for the type arguments of the current TypeInformation. |
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. |
List<TypeInformation<?>> getParameterTypes(Constructor<?> constructor)
TypeInformations for the parameters of the given Constructor.constructor - must not be null.TypeInformation<?> getProperty(String fieldname)
fieldname - boolean isCollectionLike()
Collection and Array or anything implementing Iterable. If this
returns true you can expect getComponentType() to return a non-null value.TypeInformation<?> getComponentType()
Collections or the key type for Maps.boolean isMap()
Map. If this returns true you can expect
getComponentType() as well as getMapValueType() to return something not null.TypeInformation<?> getMapValueType()
Map.Class<S> getType()
ClassTypeInformation<?> getRawTypeInformation()
ClassTypeInformation to represent the TypeInformation of the raw type of the current
instance.TypeInformation<?> getActualType()
Map value type if the type is a Map, returns the
component type if the type isCollectionLike() or the simple type if none of this applies.TypeInformation<?> getReturnType(Method method)
TypeInformation for the return type of the given Method. Will potentially resolve
generics information against the current types type parameter bindings.method - must not be null.List<TypeInformation<?>> getParameterTypes(Method method)
TypeInformations for the parameters of the given Method.method - must not be null.TypeInformation<?> getSuperTypeInformation(Class<?> superType)
TypeInformation for the given raw super type.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.boolean isAssignableFrom(TypeInformation<?> target)
TypeInformation 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>.target - List<TypeInformation<?>> getTypeArguments()
TypeInformation for the type arguments of the current TypeInformation.Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.