java.lang.Object
tools.jackson.databind.type.TypeBindings
- All Implemented Interfaces:
Serializable
Helper class used for resolving type parameters for given class
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionFactory method that will create an object that can be used as a key for caching purposes byTypeFactorystatic TypeBindingsFactory method for constructing bindings for given class using specified type parameters.static TypeBindingsstatic TypeBindingsstatic TypeBindingsstatic TypeBindingsFactory method for constructing bindings given names and associated types.static TypeBindingscreateIfNeeded(Class<?> erasedType, JavaType typeArg1) Alternate factory method that may be called if it is possible that type does or does not require type parameters; this is mostly useful for collection- and map-like types.static TypeBindingscreateIfNeeded(Class<?> erasedType, JavaType[] types) Alternate factory method that may be called if it is possible that type does or does not require type parameters; this is mostly useful for collection- and map-like types.static TypeBindingsbooleanfindBoundType(String name) Find type bound to specified name, if there is one; returns bound type if so, null if not.getBoundName(int index) getBoundType(int index) Get the type bound to the variable atindex.getBoundTypeOrNull(int index) Get the type bound to the variable atindex.Accessor for getting bound types in declaration orderinthashCode()booleanhasUnbound(String name) booleanisEmpty()protected Objectintsize()Returns number of bindings containedtoString()protected JavaType[]withoutVariable(String name) Create a new instance with the same bindings as this object, except with the given variable removed.withUnboundVariable(String name) Method for creating an instance that has same bindings as this object, plus an indicator for additional type variable that may be unbound within this context; this is needed to resolve recursive self-references.
-
Method Details
-
emptyBindings
-
readResolve
-
create
Factory method for constructing bindings for given class using specified type parameters. -
create
-
create
-
create
-
create
Factory method for constructing bindings given names and associated types. -
createIfNeeded
Alternate factory method that may be called if it is possible that type does or does not require type parameters; this is mostly useful for collection- and map-like types. -
createIfNeeded
Alternate factory method that may be called if it is possible that type does or does not require type parameters; this is mostly useful for collection- and map-like types. -
withUnboundVariable
Method for creating an instance that has same bindings as this object, plus an indicator for additional type variable that may be unbound within this context; this is needed to resolve recursive self-references. -
withoutVariable
Create a new instance with the same bindings as this object, except with the given variable removed. This is used to create generic types that are "partially raw", i.e. only have some variables bound. -
findBoundType
Find type bound to specified name, if there is one; returns bound type if so, null if not. -
isEmpty
public boolean isEmpty() -
size
public int size()Returns number of bindings contained -
getBoundName
-
getBoundType
Get the type bound to the variable atindex. If the type isnot boundbut the index is withinsize()constraints, this method returnsTypeFactory.unknownType()for compatibility. If the index is out ofsize()constraints, this method will still returnnull. -
getBoundTypeOrNull
Get the type bound to the variable atindex. If the type isnot boundor the index is withinsize()constraints, this method returnsnull.- Since:
- 2.16
-
getTypeParameters
Accessor for getting bound types in declaration order -
hasUnbound
- Since:
- 2.3
-
asKey
Factory method that will create an object that can be used as a key for caching purposes byTypeFactory- Returns:
- An object which can be used as a key in TypeFactory, or
nullif no key can be created. - Since:
- 2.8
-
toString
-
hashCode
public int hashCode() -
equals
-
typeParameterArray
-