Class TypeBindings
java.lang.Object
com.fasterxml.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 byTypeFactory
static TypeBindings
static TypeBindings
static TypeBindings
static TypeBindings
Factory method for constructing bindings for given class using specified type parameters.static TypeBindings
Factory method for constructing bindings given names and associated types.static TypeBindings
createIfNeeded
(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 TypeBindings
createIfNeeded
(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 TypeBindings
boolean
findBoundType
(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 orderint
hashCode()
boolean
hasUnbound
(String name) boolean
isEmpty()
protected Object
int
size()
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.- Since:
- 2.16
-
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 bound
but 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 bound
or 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
null
if no key can be created. - Since:
- 2.8
-
toString
-
hashCode
public int hashCode() -
equals
-
typeParameterArray
-