Class LazyType
java.lang.Object
com.github.javaparser.resolution.model.typesystem.LazyType
- All Implemented Interfaces:
ResolvedType
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
describe()
getType()
boolean
isArray()
boolean
isAssignableBy
(ResolvedType other) This method checks if ThisType t = new OtherType() would compile.boolean
isNull()
Is this the null type?boolean
Is this a primitive type?boolean
Is this a non primitive value?boolean
Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?boolean
boolean
isVoid()
boolean
replaceTypeVariables
(ResolvedTypeParameterDeclaration tp, ResolvedType replaced) This is like (ResolvedType.replaceTypeVariables(ResolvedTypeParameterDeclaration, ResolvedType, Map)
but ignores the inferred values.replaceTypeVariables
(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration, ResolvedType> inferredTypes) Replace all variables referring to the given TypeParameter with the given value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.javaparser.resolution.types.ResolvedType
asConstraintType, asUnionType, erasure, isConstraint, isInferenceVariable, isNumericType, isUnionType, mention, solveGenericTypes, toDescriptor
-
Field Details
-
concrete
-
provider
-
-
Constructor Details
-
LazyType
-
-
Method Details
-
getType
-
isArray
public boolean isArray()- Specified by:
isArray
in interfaceResolvedType
- Returns:
- true, if this type represent an array - otherwise false.
-
arrayLevel
public int arrayLevel()- Specified by:
arrayLevel
in interfaceResolvedType
- Returns:
- The level of nesting that this type is present at. For example, int[][] would have an array level of 2, and int would have an array level of 0 (not an array).
-
isPrimitive
public boolean isPrimitive()Description copied from interface:ResolvedType
Is this a primitive type?- Specified by:
isPrimitive
in interfaceResolvedType
-
isNull
public boolean isNull()Description copied from interface:ResolvedType
Is this the null type?- Specified by:
isNull
in interfaceResolvedType
-
isReference
public boolean isReference()Description copied from interface:ResolvedType
Is this a non primitive value?- Specified by:
isReference
in interfaceResolvedType
-
isReferenceType
public boolean isReferenceType()Description copied from interface:ResolvedType
Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?- Specified by:
isReferenceType
in interfaceResolvedType
-
isVoid
public boolean isVoid()- Specified by:
isVoid
in interfaceResolvedType
-
isTypeVariable
public boolean isTypeVariable()- Specified by:
isTypeVariable
in interfaceResolvedType
-
isWildcard
public boolean isWildcard()- Specified by:
isWildcard
in interfaceResolvedType
-
asArrayType
- Specified by:
asArrayType
in interfaceResolvedType
-
asReferenceType
- Specified by:
asReferenceType
in interfaceResolvedType
-
asTypeParameter
- Specified by:
asTypeParameter
in interfaceResolvedType
-
asTypeVariable
- Specified by:
asTypeVariable
in interfaceResolvedType
-
asPrimitive
- Specified by:
asPrimitive
in interfaceResolvedType
-
asWildcard
- Specified by:
asWildcard
in interfaceResolvedType
-
describe
- Specified by:
describe
in interfaceResolvedType
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration, ResolvedType> inferredTypes) Description copied from interface:ResolvedType
Replace all variables referring to the given TypeParameter with the given value. By replacing these values I could also infer some type equivalence. Those would be collected in the given map.- Specified by:
replaceTypeVariables
in interfaceResolvedType
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced) Description copied from interface:ResolvedType
This is like (ResolvedType.replaceTypeVariables(ResolvedTypeParameterDeclaration, ResolvedType, Map)
but ignores the inferred values.- Specified by:
replaceTypeVariables
in interfaceResolvedType
-
isAssignableBy
Description copied from interface:ResolvedType
This method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableBy
in interfaceResolvedType
-