Package com.fasterxml.classmate
Class TypeBindings
- java.lang.Object
-
- com.fasterxml.classmate.TypeBindings
-
public final class TypeBindings extends java.lang.ObjectHelper class used for storing binding of local type variables to matching resolved types, in context of a single class.
-
-
Field Summary
Fields Modifier and Type Field Description private int_hashCodeprivate java.lang.String[]_namesArray of type (type variable) names.private ResolvedType[]_typesTypes matching namesprivate java.lang.String[]_unboundVariablesNames of potentially unresolved type variables.private static TypeBindingsEMPTYprivate static java.lang.String[]NO_STRINGSprivate static ResolvedType[]NO_TYPES
-
Constructor Summary
Constructors Modifier Constructor Description privateTypeBindings(java.lang.String[] names, ResolvedType[] types, java.lang.String[] uvars)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeBindingscreate(java.lang.Class<?> erasedType, ResolvedType[] types)static TypeBindingscreate(java.lang.Class<?> erasedType, java.util.List<ResolvedType> typeList)Factory method for constructing bindings for given class using specified type parameters.static TypeBindingsemptyBindings()booleanequals(java.lang.Object o)ResolvedTypefindBoundType(java.lang.String name)Find type bound to specified name, if there is one; returns bound type if so, null if not.java.lang.StringgetBoundName(int index)ResolvedTypegetBoundType(int index)java.util.List<ResolvedType>getTypeParameters()Accessor for getting bound types in declaration orderinthashCode()booleanhasUnbound(java.lang.String name)booleanisEmpty()intsize()Returns number of bindings containedjava.lang.StringtoString()protected ResolvedType[]typeParameterArray()TypeBindingswithUnboundVariable(java.lang.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 Detail
-
NO_STRINGS
private static final java.lang.String[] NO_STRINGS
-
NO_TYPES
private static final ResolvedType[] NO_TYPES
-
EMPTY
private static final TypeBindings EMPTY
-
_names
private final java.lang.String[] _names
Array of type (type variable) names.
-
_types
private final ResolvedType[] _types
Types matching names
-
_unboundVariables
private final java.lang.String[] _unboundVariables
Names of potentially unresolved type variables.- Since:
- 2.3
-
_hashCode
private final int _hashCode
-
-
Constructor Detail
-
TypeBindings
private TypeBindings(java.lang.String[] names, ResolvedType[] types, java.lang.String[] uvars)
-
-
Method Detail
-
emptyBindings
public static TypeBindings emptyBindings()
-
create
public static TypeBindings create(java.lang.Class<?> erasedType, java.util.List<ResolvedType> typeList)
Factory method for constructing bindings for given class using specified type parameters.
-
create
public static TypeBindings create(java.lang.Class<?> erasedType, ResolvedType[] types)
-
withUnboundVariable
public TypeBindings withUnboundVariable(java.lang.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.- Since:
- 1.3 (renamed from "withAdditionalBinding" in 1.2)
-
findBoundType
public ResolvedType findBoundType(java.lang.String name)
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
public java.lang.String getBoundName(int index)
-
getBoundType
public ResolvedType getBoundType(int index)
-
getTypeParameters
public java.util.List<ResolvedType> getTypeParameters()
Accessor for getting bound types in declaration order
-
hasUnbound
public boolean hasUnbound(java.lang.String name)
- Since:
- 2.3
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
typeParameterArray
protected ResolvedType[] typeParameterArray()
-
-