- All Known Subinterfaces:
ParameterizedTypeInfo,VariableTypeInfo,WildcardTypeInfo
- All Known Implementing Classes:
ArrayTypeInfo,BasicClassTypeInfo,ClassTypeInfo,EnumTypeInfo,InterfaceTypeInfo,NoTypeInfo,ParameterizedTypeInfoImpl,PrimitiveClassTypeInfo,TypeInfoBase,VariableTypeInfoImpl
public interface TypeInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfouseisObjectExact()to determine whether a type represents aObjectclass, using `typeInfo == TypeInfo.OBJECT` might cause problem withVariableTypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfostatic final TypeInfo -
Method Summary
Modifier and TypeMethodDescriptionClass<?>asClass()default TypeInfoconsolidate(Map<VariableTypeInfo, TypeInfo> mapping) default Objectdefault TypeInfodefault intdefault booleandefault booleanisArray()default booleanisAssignableFrom(TypeInfo another) default booleandefault booleanisByte()default booleandefault booleanisDouble()default booleanisEnum()default booleanisFloat()default booleandefault booleanisInstance(Object o) default booleanisInt()default booleandefault booleanisLong()default booleandefault booleanisNumber()default booleandefault booleandefault booleanisShort()default booleanisString()default booleanisVoid()default ObjectnewArray(int length) get an array whose element type is the caller TypeInfodefault TypeInfoparam(int index) Example:default booleantoString()
-
Field Details
-
NONE
-
OBJECT
useisObjectExact()to determine whether a type represents aObjectclass, using `typeInfo == TypeInfo.OBJECT` might cause problem withVariableTypeInfo -
OBJECT_ARRAY
-
PRIMITIVE_VOID
-
PRIMITIVE_BOOLEAN
-
PRIMITIVE_BYTE
-
PRIMITIVE_SHORT
-
PRIMITIVE_INT
-
PRIMITIVE_LONG
-
PRIMITIVE_FLOAT
-
PRIMITIVE_DOUBLE
-
PRIMITIVE_CHARACTER
-
VOID
-
BOOLEAN
-
BYTE
-
SHORT
-
INT
-
LONG
-
FLOAT
-
DOUBLE
-
CHARACTER
-
NUMBER
-
STRING
-
STRING_ARRAY
-
RAW_CLASS
-
DATE
-
RUNNABLE
-
RAW_CONSUMER
-
RAW_SUPPLIER
-
RAW_FUNCTION
-
RAW_PREDICATE
-
RAW_LIST
-
RAW_SET
-
RAW_MAP
-
RAW_OPTIONAL
-
RAW_ENUM_SET
-
BIG_INT
-
-
Method Details
-
asClass
Class<?> asClass() -
param
Example:1. for
Map<String, Integer>,param(-1)==NONE,param(0)==STRING,param(1)==INT,param(2)==NONE2. for
Map(raw usage of generic class) orInteger(not generic class),param(anyNumberHere)==NONE- Returns:
- the actual type parameter at provided index, or
NONEif:1. index not in valid range, or
2. the TypeInfo itself is not representing a
ParameterizedType - See Also:
-
is
- Returns:
- true if this TypeInfo represents the same class as the
Classparameter, false otherwise
-
isNot
- Returns:
trueif this TypeInfo does NOT represent the same class as theClassparameter,falseotherwise
-
isPrimitive
default boolean isPrimitive()- See Also:
-
shouldReplace
default boolean shouldReplace()- Returns:
trueif this type contains too little information (e.g. beingNONE) and should be replaced by actual object type,falseotherwise
-
toString
String toString() -
toString
-
getComponentType
- See Also:
-
newArray
get an array whose element type is the caller TypeInfo -
isInterface
default boolean isInterface()- See Also:
-
isFunctionalInterface
default boolean isFunctionalInterface()- See Also:
-
isEnum
default boolean isEnum()- See Also:
-
enumConstants
- See Also:
-
createDefaultValue
-
isVoid
default boolean isVoid()- Returns:
- true if this TypeInfo represents
Voidclass orvoidclass
-
isBoolean
default boolean isBoolean()- Returns:
- true if this TypeInfo represents
Booleanclass orbooleanclass
-
isNumber
default boolean isNumber()- Returns:
- true if this TypeInfo represents a type assignable to
Numberclass - See Also:
-
isByte
default boolean isByte()- Returns:
- true if this TypeInfo represents
Byteclass orbyteclass
-
isShort
default boolean isShort()- Returns:
- true if this TypeInfo represents
Shortclass orshortclass
-
isInt
default boolean isInt()- Returns:
- true if this TypeInfo represents
Integerclass orintclass
-
isLong
default boolean isLong()- Returns:
- true if this TypeInfo represents
Longclass orlongclass
-
isFloat
default boolean isFloat()- Returns:
- true if this TypeInfo represents
Floatclass orfloatclass
-
isDouble
default boolean isDouble()- Returns:
- true if this TypeInfo represents
Doubleclass ordoubleclass
-
isCharacter
default boolean isCharacter()- Returns:
- true if this TypeInfo represents
Characterclass orcharclass
-
isString
default boolean isString()- Returns:
- true if this TypeInfo represents
Stringclass
-
isObjectExact
default boolean isObjectExact()- Returns:
- true if this TypeInfo represents
Objectclass
-
isArray
default boolean isArray()- See Also:
-
isAssignableFrom
- Returns:
trueif the caller TypeInfo represents the super class of the class represented byanotherTypeInfo- See Also:
-
isInstance
- Returns:
- true if
ois an instance of this class represented by the caller TypeInfo - See Also:
-
getTypeTag
default int getTypeTag()- See Also:
-
consolidate
-