Class LazyType
- java.lang.Object
-
- com.github.javaparser.resolution.model.typesystem.LazyType
-
- All Implemented Interfaces:
ResolvedType
public class LazyType extends Object implements ResolvedType
-
-
Constructor Summary
Constructors Constructor Description LazyType(Function<Void,ResolvedType> provider)
-
Method Summary
-
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
-
-
-
-
Constructor Detail
-
LazyType
public LazyType(Function<Void,ResolvedType> provider)
-
-
Method Detail
-
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
public ResolvedArrayType asArrayType()
- Specified by:
asArrayType
in interfaceResolvedType
-
asReferenceType
public ResolvedReferenceType asReferenceType()
- Specified by:
asReferenceType
in interfaceResolvedType
-
asTypeParameter
public ResolvedTypeParameterDeclaration asTypeParameter()
- Specified by:
asTypeParameter
in interfaceResolvedType
-
asTypeVariable
public ResolvedTypeVariable asTypeVariable()
- Specified by:
asTypeVariable
in interfaceResolvedType
-
asPrimitive
public ResolvedPrimitiveType asPrimitive()
- Specified by:
asPrimitive
in interfaceResolvedType
-
asWildcard
public ResolvedWildcard asWildcard()
- Specified by:
asWildcard
in interfaceResolvedType
-
describe
public String 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
public boolean isAssignableBy(ResolvedType other)
Description copied from interface:ResolvedType
This method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableBy
in interfaceResolvedType
-
-