public class TypeBindings extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
Object |
asKey(Class<?> rawBase)
Factory method that will create an object that can be used as a key for
caching purposes by
TypeFactory |
static TypeBindings |
create(Class<?> erasedType,
JavaType typeArg1) |
static TypeBindings |
create(Class<?> erasedType,
JavaType[] types) |
static TypeBindings |
create(Class<?> erasedType,
JavaType typeArg1,
JavaType typeArg2) |
static TypeBindings |
create(Class<?> erasedType,
List<JavaType> typeList)
Factory method for constructing bindings for given class using specified type
parameters.
|
static TypeBindings |
create(List<String> names,
List<JavaType> types)
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 |
emptyBindings() |
boolean |
equals(Object o) |
JavaType |
findBoundType(String name)
Find type bound to specified name, if there is one; returns bound type if so, null if not.
|
String |
getBoundName(int index) |
JavaType |
getBoundType(int index)
Get the type bound to the variable at
index . |
JavaType |
getBoundTypeOrNull(int index)
Get the type bound to the variable at
index . |
List<JavaType> |
getTypeParameters()
Accessor for getting bound types in declaration order
|
int |
hashCode() |
boolean |
hasUnbound(String name) |
boolean |
isEmpty() |
protected Object |
readResolve() |
int |
size()
Returns number of bindings contained
|
String |
toString() |
protected JavaType[] |
typeParameterArray() |
TypeBindings |
withoutVariable(String name)
Create a new instance with the same bindings as this object, except with
the given variable removed.
|
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.
|
public static TypeBindings emptyBindings()
protected Object readResolve()
public static TypeBindings create(Class<?> erasedType, List<JavaType> typeList)
public static TypeBindings create(Class<?> erasedType, JavaType[] types)
public static TypeBindings create(Class<?> erasedType, JavaType typeArg1)
public static TypeBindings create(Class<?> erasedType, JavaType typeArg1, JavaType typeArg2)
public static TypeBindings create(List<String> names, List<JavaType> types)
public static TypeBindings createIfNeeded(Class<?> erasedType, JavaType typeArg1)
public static TypeBindings createIfNeeded(Class<?> erasedType, JavaType[] types)
public TypeBindings withUnboundVariable(String name)
public TypeBindings withoutVariable(String name)
public JavaType findBoundType(String name)
public boolean isEmpty()
public int size()
public String getBoundName(int index)
public JavaType getBoundType(int index)
index
. If the type is not bound
but the index is within size()
constraints, this method returns TypeFactory.unknownType()
for
compatibility. If the index is out of size()
constraints, this method will still return null
.public JavaType getBoundTypeOrNull(int index)
index
. If the type is not bound
or the index is within size()
constraints, this method returns null
.public List<JavaType> getTypeParameters()
public boolean hasUnbound(String name)
public Object asKey(Class<?> rawBase)
TypeFactory
null
if no key can be created.protected JavaType[] typeParameterArray()
Copyright © 2008–2024 FasterXML. All rights reserved.