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
-
getType
public ResolvedType getType()
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceResolvedType- Returns:
- true, if this type represent an array - otherwise false.
-
arrayLevel
public int arrayLevel()
- Specified by:
arrayLevelin 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:ResolvedTypeIs this a primitive type?- Specified by:
isPrimitivein interfaceResolvedType
-
isNull
public boolean isNull()
Description copied from interface:ResolvedTypeIs this the null type?- Specified by:
isNullin interfaceResolvedType
-
isReference
public boolean isReference()
Description copied from interface:ResolvedTypeIs this a non primitive value?- Specified by:
isReferencein interfaceResolvedType
-
isReferenceType
public boolean isReferenceType()
Description copied from interface:ResolvedTypeCan this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?- Specified by:
isReferenceTypein interfaceResolvedType
-
isVoid
public boolean isVoid()
- Specified by:
isVoidin interfaceResolvedType
-
isTypeVariable
public boolean isTypeVariable()
- Specified by:
isTypeVariablein interfaceResolvedType
-
isWildcard
public boolean isWildcard()
- Specified by:
isWildcardin interfaceResolvedType
-
asArrayType
public ResolvedArrayType asArrayType()
- Specified by:
asArrayTypein interfaceResolvedType
-
asReferenceType
public ResolvedReferenceType asReferenceType()
- Specified by:
asReferenceTypein interfaceResolvedType
-
asTypeParameter
public ResolvedTypeParameterDeclaration asTypeParameter()
- Specified by:
asTypeParameterin interfaceResolvedType
-
asTypeVariable
public ResolvedTypeVariable asTypeVariable()
- Specified by:
asTypeVariablein interfaceResolvedType
-
asPrimitive
public ResolvedPrimitiveType asPrimitive()
- Specified by:
asPrimitivein interfaceResolvedType
-
asWildcard
public ResolvedWildcard asWildcard()
- Specified by:
asWildcardin interfaceResolvedType
-
describe
public String describe()
- Specified by:
describein interfaceResolvedType
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration,ResolvedType> inferredTypes)
Description copied from interface:ResolvedTypeReplace 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:
replaceTypeVariablesin interfaceResolvedType
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced)
Description copied from interface:ResolvedTypeThis is like (ResolvedType.replaceTypeVariables(ResolvedTypeParameterDeclaration, ResolvedType, Map)but ignores the inferred values.- Specified by:
replaceTypeVariablesin interfaceResolvedType
-
isAssignableBy
public boolean isAssignableBy(ResolvedType other)
Description copied from interface:ResolvedTypeThis method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableByin interfaceResolvedType
-
-