public interface Type
class A<Bgt; { }
where B is a TypeVariable. It could also be Wildcard Type, possibly with constraints.
Modifier and Type | Method and Description |
---|---|
default int |
arrayLevel() |
default ArrayType |
asArrayType() |
default LambdaConstraintType |
asConstraintType() |
default PrimitiveType |
asPrimitive() |
default ReferenceType |
asReferenceType() |
default TypeParameterDeclaration |
asTypeParameter() |
default TypeVariable |
asTypeVariable() |
default Wildcard |
asWildcard() |
java.lang.String |
describe() |
default boolean |
isArray()
Does this type represent an array?
|
boolean |
isAssignableBy(Type other)
This method checks if ThisType t = new OtherType() would compile.
|
default boolean |
isConstraint()
Is this a lambda constraint type?
|
default boolean |
isNull()
Is this the null type?
|
default boolean |
isPrimitive()
Is this a primitive type?
|
default boolean |
isReference()
Is this a non primitive value?
|
default boolean |
isReferenceType()
Can this be seen as a ReferenceTypeUsage?
In other words: is this a reference to a class, an interface or an enum?
|
default boolean |
isTypeVariable() |
default boolean |
isVoid() |
default boolean |
isWildcard() |
default Type |
replaceTypeVariables(TypeParameterDeclaration tp,
Type replaced)
This is like (
replaceTypeVariables(TypeParameterDeclaration, Type, Map) but ignores the inferred values. |
default Type |
replaceTypeVariables(TypeParameterDeclaration tp,
Type replaced,
java.util.Map<TypeParameterDeclaration,Type> inferredTypes)
Replace all variables referring to the given TypeParameter with the given value.
|
default boolean isArray()
default int arrayLevel()
default boolean isPrimitive()
default boolean isNull()
default boolean isReference()
default boolean isConstraint()
default boolean isReferenceType()
default boolean isVoid()
default boolean isTypeVariable()
default boolean isWildcard()
default ArrayType asArrayType()
default ReferenceType asReferenceType()
default TypeParameterDeclaration asTypeParameter()
default TypeVariable asTypeVariable()
default PrimitiveType asPrimitive()
default Wildcard asWildcard()
default LambdaConstraintType asConstraintType()
java.lang.String describe()
default Type replaceTypeVariables(TypeParameterDeclaration tp, Type replaced, java.util.Map<TypeParameterDeclaration,Type> inferredTypes)
default Type replaceTypeVariables(TypeParameterDeclaration tp, Type replaced)
replaceTypeVariables(TypeParameterDeclaration, Type, Map)
but ignores the inferred values.boolean isAssignableBy(Type other)