Modifier and Type | Class and Description |
---|---|
pack-priv static class | TypeBindings.
Helper type used to allow caching of generic types |
pack-priv static class | TypeBindings.
Helper class that contains simple logic for avoiding repeated lookups via
|
Modifier and Type | Field and Description |
---|---|
private final int | |
private final String[] | _names
Array of type (type variable) names. |
private final JavaType[] | _types
Types matching names |
private final String[] | _unboundVariables
Names of potentially unresolved type variables. |
private static final TypeBindings | |
private static final String[] | |
private static final JavaType[] | |
private static final long |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public Object | Returns: An object which can be used as a key in TypeFactory, ornull if no key can be created.Factory method that will create an object that can be used as a key for
caching purposes by |
public static TypeBindings | |
public static TypeBindings | |
public static TypeBindings | |
public static TypeBindings | |
public static TypeBindings | |
public 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. |
public 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. |
public static TypeBindings | |
public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
public JavaType | findBoundType(String name)
Find type bound to specified name, if there is one; returns bound type if so, null if not. |
public String | |
public JavaType | |
public JavaType | |
public List | |
public int | |
public boolean | |
private boolean | invalidCacheKey()
Returns true if a shallow search of the type bindings includes a placeholder type which uses reference equality, thus cannot produce cache hits. |
public boolean | |
protected Object | |
public int | |
public String | |
protected JavaType[] | |
public TypeBindings | withoutVariable(String name)
Create a new instance with the same bindings as this object, except with the given variable removed. |
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. |
_hashCode | back to summary |
---|---|
private final int _hashCode |
_names | back to summary |
---|---|
private final String[] _names Array of type (type variable) names. |
_types | back to summary |
---|---|
private final JavaType[] _types Types matching names |
_unboundVariables | back to summary |
---|---|
private final String[] _unboundVariables Names of potentially unresolved type variables.
|
EMPTY | back to summary |
---|---|
private static final TypeBindings EMPTY |
NO_STRINGS | back to summary |
---|---|
private static final String[] NO_STRINGS |
NO_TYPES | back to summary |
---|---|
private static final JavaType[] NO_TYPES |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
TypeBindings | back to summary |
---|---|
private TypeBindings(String[] names, JavaType[] types, String[] uvars) |
asKey | back to summary |
---|---|
public Object asKey(Class<?> rawBase) Factory method that will create an object that can be used as a key for
caching purposes by
|
create | back to summary |
---|---|
public static TypeBindings create(Class<?> erasedType, List<JavaType> typeList) Factory method for constructing bindings for given class using specified type parameters. |
create | back to summary |
---|---|
public static TypeBindings create(Class<?> erasedType, JavaType[] types) |
create | back to summary |
---|---|
public static TypeBindings create(Class<?> erasedType, JavaType typeArg1) |
create | back to summary |
---|---|
public static TypeBindings create(Class<?> erasedType, JavaType typeArg1, JavaType typeArg2) |
create | back to summary |
---|---|
public static TypeBindings create(List<String> names, List<JavaType> types) Factory method for constructing bindings given names and associated types. |
createIfNeeded | back to summary |
---|---|
public 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. |
createIfNeeded | back to summary |
---|---|
public 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. |
emptyBindings | back to summary |
---|---|
public static TypeBindings emptyBindings() |
equals | back to summary |
---|---|
public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. |
findBoundType | back to summary |
---|---|
public JavaType findBoundType(String name) Find type bound to specified name, if there is one; returns bound type if so, null if not. |
getBoundName | back to summary |
---|---|
public String getBoundName(int index) |
getBoundType | back to summary |
---|---|
public JavaType getBoundType(int index) Get the type bound to the variable at |
getBoundTypeOrNull | back to summary |
---|---|
public JavaType getBoundTypeOrNull(int index) Get the type bound to the variable at
|
getTypeParameters | back to summary |
---|---|
public List Accessor for getting bound types in declaration order |
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
|
hasUnbound | back to summary |
---|---|
public boolean hasUnbound(String name)
|
invalidCacheKey | back to summary |
---|---|
private boolean invalidCacheKey() Returns true if a shallow search of the type bindings includes a placeholder type which uses reference equality, thus cannot produce cache hits. This is an optimization to avoid churning memory in the cache unnecessarily. Note that it is still possible for nested type information to contain such placeholder types (see NestedTypes1604Test for an example) so it's vital that they produce a distribution of hashCode values, even if they may push reusable data out of the cache. |
isEmpty | back to summary |
---|---|
public boolean isEmpty() |
readResolve | back to summary |
---|---|
protected Object readResolve() |
size | back to summary |
---|---|
public int size() Returns number of bindings contained |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
typeParameterArray | back to summary |
---|---|
protected JavaType[] typeParameterArray() |
withoutVariable | back to summary |
---|---|
public TypeBindings withoutVariable(String name) Create a new instance with the same bindings as this object, except with the given variable removed. This is used to create generic types that are "partially raw", i.e. only have some variables bound.
|
withUnboundVariable | back to summary |
---|---|
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. |
Modifier and Type | Field and Description |
---|---|
private final int | |
private final JavaType[] | |
private final Class |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
public int | |
public String |
_hash | back to summary |
---|---|
private final int _hash |
_params | back to summary |
---|---|
private final JavaType[] _params |
_raw | back to summary |
---|---|
private final Class<?> _raw |
AsKey | back to summary |
---|---|
public AsKey(Class<?> raw, JavaType[] params, int hash) |
equals | back to summary |
---|---|
public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. |
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
Class#getTypeParameters()
as that can be a performance issue for
some use cases (wasteful, usually one-off or not reusing mapper).
Partly isolated to avoid initialization for cases where no generic types are
used.
Modifier and Type | Field and Description |
---|---|
private static final TypeVariable | |
private static final TypeVariable | |
private static final TypeVariable | |
private static final TypeVariable | |
private static final TypeVariable | |
private static final TypeVariable | |
private static final TypeVariable | |
private static final TypeVariable |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public static TypeVariable | |
public static TypeVariable |
VARS_ABSTRACT_LIST | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_ABSTRACT_LIST |
VARS_ARRAY_LIST | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_ARRAY_LIST |
VARS_COLLECTION | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_COLLECTION |
VARS_HASH_MAP | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_HASH_MAP |
VARS_ITERABLE | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_ITERABLE |
VARS_LINKED_HASH_MAP | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_LINKED_HASH_MAP |
VARS_LIST | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_LIST |
VARS_MAP | back to summary |
---|---|
private static final TypeVariable<?>[] VARS_MAP |
TypeParamStash | back to summary |
---|---|
pack-priv TypeParamStash() |
paramsFor1 | back to summary |
---|---|
public static TypeVariable |
paramsFor2 | back to summary |
---|---|
public static TypeVariable |