public interface TypeInfo
| Modifier and Type | Method and Description |
|---|---|
void |
append(TypeFormatContext ctx,
StringBuilder builder) |
Class<?> |
asClass()
|
default void |
collectComponentClass(Consumer<Class<?>> collector) |
default TypeInfo |
consolidate(Map<VariableTypeInfo,TypeInfo> mapping) |
default Object |
createDefaultValue() |
default List<Object> |
enumConstants() |
default TypeInfo |
getComponentType() |
default int |
getTypeTag() |
default boolean |
is(Class<?> c) |
default boolean |
isArray() |
default boolean |
isAssignableFrom(TypeInfo another) |
default boolean |
isBoolean() |
default boolean |
isByte() |
default boolean |
isCharacter() |
default boolean |
isDouble() |
default boolean |
isEnum() |
default boolean |
isFloat() |
default boolean |
isFunctionalInterface() |
default boolean |
isInstance(Object o) |
default boolean |
isInt() |
default boolean |
isInterface() |
default boolean |
isLong() |
default boolean |
isNot(Class<?> c) |
default boolean |
isNumber() |
default boolean |
isObjectExact() |
default boolean |
isPrimitive() |
default boolean |
isShort() |
default boolean |
isString() |
default boolean |
isVoid() |
default Object |
newArray(int length)
get an array whose element type is the caller TypeInfo
|
default TypeInfo |
param(int index)
|
default boolean |
shouldConvert() |
String |
toString() |
static final TypeInfo NONE
static final TypeInfo OBJECT
isObjectExact() to determine whether a type represents a Object
class, using `typeInfo == TypeInfo.OBJECT` might cause problem with VariableTypeInfostatic final TypeInfo OBJECT_ARRAY
static final TypeInfo PRIMITIVE_VOID
static final TypeInfo PRIMITIVE_BOOLEAN
static final TypeInfo PRIMITIVE_BYTE
static final TypeInfo PRIMITIVE_SHORT
static final TypeInfo PRIMITIVE_INT
static final TypeInfo PRIMITIVE_LONG
static final TypeInfo PRIMITIVE_FLOAT
static final TypeInfo PRIMITIVE_DOUBLE
static final TypeInfo PRIMITIVE_CHARACTER
static final TypeInfo VOID
static final TypeInfo BOOLEAN
static final TypeInfo BYTE
static final TypeInfo SHORT
static final TypeInfo INT
static final TypeInfo LONG
static final TypeInfo FLOAT
static final TypeInfo DOUBLE
static final TypeInfo CHARACTER
static final TypeInfo NUMBER
static final TypeInfo STRING
static final TypeInfo STRING_ARRAY
static final TypeInfo RAW_CLASS
static final TypeInfo DATE
static final TypeInfo RUNNABLE
static final TypeInfo RAW_CONSUMER
static final TypeInfo RAW_SUPPLIER
static final TypeInfo RAW_FUNCTION
static final TypeInfo RAW_PREDICATE
static final TypeInfo RAW_LIST
static final TypeInfo RAW_SET
static final TypeInfo RAW_MAP
static final TypeInfo RAW_OPTIONAL
static final TypeInfo RAW_ENUM_SET
static final TypeInfo BIG_INT
Class<?> asClass()
default TypeInfo param(int index)
1. for Map<String, Integer>, param(-1) == NONE, param(0) == STRING, param(1) == INT, param(2) == NONE
2. for Map (raw usage of generic class) or Integer (not generic class),
param(anyNumberHere) == NONE
NONE if:
1. index not in valid range, or
2. the TypeInfo itself is not representing a ParameterizedType
ParameterizedTypeInfo.params()default boolean is(Class<?> c)
Class parameter, false
otherwisedefault boolean isNot(Class<?> c)
true if this TypeInfo does NOT represent the same class as the Class
parameter, false otherwisedefault boolean isPrimitive()
Class.isPrimitive()default boolean shouldConvert()
String toString()
toString in class Objectappend(TypeFormatContext, StringBuilder)void append(TypeFormatContext ctx, StringBuilder builder)
default TypeInfo getComponentType()
Class.getComponentType()default Object newArray(int length)
default boolean isInterface()
Class.isInterface()default boolean isFunctionalInterface()
FunctionalInterfacedefault boolean isEnum()
Class.isEnum()default List<Object> enumConstants()
Class.getEnumConstants()default Object createDefaultValue()
default boolean isVoid()
Void class or void classdefault boolean isBoolean()
Boolean class or boolean classdefault boolean isNumber()
Number classisAssignableFrom(TypeInfo)default boolean isByte()
Byte class or byte classdefault boolean isShort()
Short class or short classdefault boolean isInt()
Integer class or int classdefault boolean isLong()
Long class or long classdefault boolean isFloat()
Float class or float classdefault boolean isDouble()
Double class or double classdefault boolean isCharacter()
Character class or char classdefault boolean isString()
String classdefault boolean isObjectExact()
Object classdefault boolean isArray()
Class.isArray()default boolean isAssignableFrom(TypeInfo another)
true if the caller TypeInfo represents the super class of the class
represented by another TypeInfoClass.isAssignableFrom(Class)default boolean isInstance(Object o)
o is an instance of this class represented by the caller TypeInfoClass.isInstance(Object)default int getTypeTag()
FunctionObject.getTypeTag(Class)default TypeInfo consolidate(Map<VariableTypeInfo,TypeInfo> mapping)
Copyright © 2025 HtmlUnit. All rights reserved.