Package com.fasterxml.classmate
Class TypeBindings
java.lang.Object
com.fasterxml.classmate.TypeBindings
Helper class used for storing binding of local type variables to
matching resolved types, in context of a single class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final String[]
Array of type (type variable) names.private final ResolvedType[]
Types matching namesprivate final String[]
Names of potentially unresolved type variables.private static final TypeBindings
private static final String[]
private static final ResolvedType[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TypeBindings
(String[] names, ResolvedType[] types, String[] uvars) -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeBindings
create
(Class<?> erasedType, ResolvedType[] types) static TypeBindings
create
(Class<?> erasedType, List<ResolvedType> typeList) Factory method for constructing bindings for given class using specified type parameters.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) Accessor for getting bound types in declaration orderint
hashCode()
boolean
hasUnbound
(String name) boolean
isEmpty()
int
size()
Returns number of bindings containedtoString()
protected ResolvedType[]
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.
-
Field Details
-
NO_STRINGS
-
NO_TYPES
-
EMPTY
-
_names
Array of type (type variable) names. -
_types
Types matching names -
_unboundVariables
Names of potentially unresolved type variables.- Since:
- 2.3
-
_hashCode
private final int _hashCode
-
-
Constructor Details
-
TypeBindings
-
-
Method Details
-
emptyBindings
-
create
Factory method for constructing bindings for given class using specified type parameters. -
create
-
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.- Since:
- 1.3 (renamed from "withAdditionalBinding" in 1.2)
-
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
-
getTypeParameters
Accessor for getting bound types in declaration order -
hasUnbound
- Since:
- 2.3
-
toString
-
hashCode
public int hashCode() -
equals
-
typeParameterArray
-