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 intprivate 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 TypeBindingsprivate static final String[]private static final ResolvedType[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTypeBindings(String[] names, ResolvedType[] types, String[] uvars) -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeBindingscreate(Class<?> erasedType, ResolvedType[] types) static TypeBindingscreate(Class<?> erasedType, List<ResolvedType> typeList) Factory method for constructing bindings for given class using specified type parameters.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) Accessor for getting bound types in declaration orderinthashCode()booleanhasUnbound(String name) booleanisEmpty()intsize()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
-
_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
-
equals
-
typeParameterArray
-