public class TypeBindings
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
(package private) static class |
TypeBindings.AsKey
Helper type used to allow caching of generic types
|
(package private) static class |
TypeBindings.TypeParamStash
Helper class that contains simple logic for avoiding repeated lookups via
Class.getTypeParameters() as that can be a performance issue for
some use cases (wasteful, usually one-off or not reusing mapper). |
Modifier and Type | Field and Description |
---|---|
private int |
_hashCode |
private java.lang.String[] |
_names
Array of type (type variable) names.
|
private JavaType[] |
_types
Types matching names
|
private java.lang.String[] |
_unboundVariables
Names of potentially unresolved type variables.
|
private static TypeBindings |
EMPTY |
private static java.lang.String[] |
NO_STRINGS |
private static JavaType[] |
NO_TYPES |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
private |
TypeBindings(java.lang.String[] names,
JavaType[] types,
java.lang.String[] uvars) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
asKey(java.lang.Class<?> rawBase)
Factory method that will create an object that can be used as a key for
caching purposes by
TypeFactory |
static TypeBindings |
create(java.lang.Class<?> erasedType,
JavaType typeArg1) |
static TypeBindings |
create(java.lang.Class<?> erasedType,
JavaType[] types) |
static TypeBindings |
create(java.lang.Class<?> erasedType,
JavaType typeArg1,
JavaType typeArg2) |
static TypeBindings |
create(java.lang.Class<?> erasedType,
java.util.List<JavaType> typeList)
Factory method for constructing bindings for given class using specified type
parameters.
|
static TypeBindings |
createIfNeeded(java.lang.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(java.lang.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(java.lang.Object o) |
JavaType |
findBoundType(java.lang.String name)
Find type bound to specified name, if there is one; returns bound type if so, null if not.
|
java.lang.String |
getBoundName(int index) |
JavaType |
getBoundType(int index) |
java.util.List<JavaType> |
getTypeParameters()
Accessor for getting bound types in declaration order
|
int |
hashCode() |
boolean |
hasUnbound(java.lang.String name) |
boolean |
isEmpty() |
protected java.lang.Object |
readResolve() |
int |
size()
Returns number of bindings contained
|
java.lang.String |
toString() |
protected JavaType[] |
typeParameterArray() |
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.
|
private static final long serialVersionUID
private static final java.lang.String[] NO_STRINGS
private static final JavaType[] NO_TYPES
private static final TypeBindings EMPTY
private final java.lang.String[] _names
private final JavaType[] _types
private final java.lang.String[] _unboundVariables
private final int _hashCode
private TypeBindings(java.lang.String[] names, JavaType[] types, java.lang.String[] uvars)
public static TypeBindings emptyBindings()
protected java.lang.Object readResolve()
public static TypeBindings create(java.lang.Class<?> erasedType, java.util.List<JavaType> typeList)
public static TypeBindings create(java.lang.Class<?> erasedType, JavaType[] types)
public static TypeBindings create(java.lang.Class<?> erasedType, JavaType typeArg1)
public static TypeBindings create(java.lang.Class<?> erasedType, JavaType typeArg1, JavaType typeArg2)
public static TypeBindings createIfNeeded(java.lang.Class<?> erasedType, JavaType typeArg1)
public static TypeBindings createIfNeeded(java.lang.Class<?> erasedType, JavaType[] types)
public TypeBindings withUnboundVariable(java.lang.String name)
public JavaType findBoundType(java.lang.String name)
public boolean isEmpty()
public int size()
public java.lang.String getBoundName(int index)
public JavaType getBoundType(int index)
public java.util.List<JavaType> getTypeParameters()
public boolean hasUnbound(java.lang.String name)
public java.lang.Object asKey(java.lang.Class<?> rawBase)
TypeFactory
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected JavaType[] typeParameterArray()