Package com.fasterxml.classmate
Class TypeBindings
- java.lang.Object
-
- com.fasterxml.classmate.TypeBindings
-
public final class TypeBindings extends Object
Helper class used for storing binding of local type variables to matching resolved types, in context of a single class.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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 TypeBindingsemptyBindings()booleanequals(Object o)ResolvedTypefindBoundType(String name)Find type bound to specified name, if there is one; returns bound type if so, null if not.StringgetBoundName(int index)ResolvedTypegetBoundType(int index)List<ResolvedType>getTypeParameters()Accessor for getting bound types in declaration orderinthashCode()booleanhasUnbound(String name)booleanisEmpty()intsize()Returns number of bindings containedStringtoString()protected ResolvedType[]typeParameterArray()TypeBindingswithUnboundVariable(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 Detail
-
emptyBindings
public static TypeBindings emptyBindings()
-
create
public static TypeBindings create(Class<?> erasedType, List<ResolvedType> typeList)
Factory method for constructing bindings for given class using specified type parameters.
-
create
public static TypeBindings create(Class<?> erasedType, ResolvedType[] types)
-
withUnboundVariable
public TypeBindings 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.- Since:
- 1.3 (renamed from "withAdditionalBinding" in 1.2)
-
findBoundType
public ResolvedType findBoundType(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 String getBoundName(int index)
-
getBoundType
public ResolvedType getBoundType(int index)
-
getTypeParameters
public List<ResolvedType> getTypeParameters()
Accessor for getting bound types in declaration order
-
hasUnbound
public boolean hasUnbound(String name)
- Since:
- 2.3
-
typeParameterArray
protected ResolvedType[] typeParameterArray()
-
-