public final class ParameterizedTypeInfoImpl extends TypeInfoBase implements ParameterizedTypeInfo
BIG_INT, BOOLEAN, BYTE, CHARACTER, DATE, DOUBLE, FLOAT, INT, LONG, NONE, NUMBER, OBJECT, OBJECT_ARRAY, PRIMITIVE_BOOLEAN, PRIMITIVE_BYTE, PRIMITIVE_CHARACTER, PRIMITIVE_DOUBLE, PRIMITIVE_FLOAT, PRIMITIVE_INT, PRIMITIVE_LONG, PRIMITIVE_SHORT, PRIMITIVE_VOID, RAW_CLASS, RAW_CONSUMER, RAW_ENUM_SET, RAW_FUNCTION, RAW_LIST, RAW_MAP, RAW_OPTIONAL, RAW_PREDICATE, RAW_SET, RAW_SUPPLIER, RUNNABLE, SHORT, STRING, STRING_ARRAY, VOID| Constructor and Description |
|---|
ParameterizedTypeInfoImpl(TypeInfo rawType,
List<TypeInfo> params) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(TypeFormatContext ctx,
StringBuilder builder) |
Class<?> |
asClass()
|
void |
collectComponentClass(Consumer<Class<?>> collector) |
TypeInfo |
consolidate(Map<VariableTypeInfo,TypeInfo> mapping) |
boolean |
equals(Object object) |
Map<VariableTypeInfo,TypeInfo> |
extractConsolidationMapping(TypeInfoFactory factory)
Extract consolidation mapping based on
ParameterizedTypeInfo.params() and Class.getTypeParameters()
Example: type is List<String>, calling ((ParameterizedTypeInfo)
type).extractConsolidationMapping(TypeInfoFactory.GLOBAL) will give E -> String,
where the E the type variable declared by List |
int |
hashCode() |
boolean |
is(Class<?> c) |
Object |
newArray(int length)
get an array whose element type is the caller TypeInfo
|
TypeInfo |
param(int index)
Example:
1. for
Map<String, Integer>, param(-1) == TypeInfo.NONE, param(0) == TypeInfo.STRING, param(1) == TypeInfo.INT, param(2) == TypeInfo.NONE
2. for Map (raw usage of generic class) or Integer (not generic class),
param(anyNumberHere) == TypeInfo.NONE |
List<TypeInfo> |
params() |
TypeInfo |
rawType() |
toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetTypeTag, isAssignableFrom, isFunctionalInterface, isInstance, isInterfacecreateDefaultValue, enumConstants, getComponentType, isArray, isBoolean, isByte, isCharacter, isDouble, isEnum, isFloat, isInt, isLong, isNot, isNumber, isObjectExact, isPrimitive, isShort, isString, isVoid, shouldReplace, toStringpublic boolean is(Class<?> c)
public TypeInfo param(int index)
TypeInfo1. for Map<String, Integer>, param(-1) == TypeInfo.NONE, param(0) == TypeInfo.STRING, param(1) == TypeInfo.INT, param(2) == TypeInfo.NONE
2. for Map (raw usage of generic class) or Integer (not generic class),
param(anyNumberHere) == TypeInfo.NONE
param in interface ParameterizedTypeInfoparam in interface TypeInfoTypeInfo.NONE if:
1. index not in valid range, or
2. the TypeInfo itself is not representing a ParameterizedType
ParameterizedTypeInfo.params()public Map<VariableTypeInfo,TypeInfo> extractConsolidationMapping(TypeInfoFactory factory)
ParameterizedTypeInfoParameterizedTypeInfo.params() and Class.getTypeParameters()
Example: type is List<String>, calling ((ParameterizedTypeInfo)
type).extractConsolidationMapping(TypeInfoFactory.GLOBAL) will give E -> String,
where the E the type variable declared by List
extractConsolidationMapping in interface ParameterizedTypeInfopublic void append(TypeFormatContext ctx, StringBuilder builder)
public TypeInfo rawType()
rawType in interface ParameterizedTypeInfoParameterizedType.getRawType()public List<TypeInfo> params()
params in interface ParameterizedTypeInfoParameterizedType.getActualTypeArguments()public Object newArray(int length)
TypeInfonewArray in interface TypeInfonewArray in class TypeInfoBasepublic void collectComponentClass(Consumer<Class<?>> collector)
collectComponentClass in interface TypeInfopublic TypeInfo consolidate(Map<VariableTypeInfo,TypeInfo> mapping)
consolidate in interface TypeInfoCopyright © 2025 HtmlUnit. All rights reserved.