Class LazyType
- java.lang.Object
-
- com.github.javaparser.resolution.model.typesystem.LazyType
-
- All Implemented Interfaces:
ResolvedType
public class LazyType extends java.lang.Object implements ResolvedType
-
-
Field Summary
Fields Modifier and Type Field Description private ResolvedType
concrete
private java.util.function.Function<java.lang.Void,ResolvedType>
provider
-
Constructor Summary
Constructors Constructor Description LazyType(java.util.function.Function<java.lang.Void,ResolvedType> provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
arrayLevel()
ResolvedArrayType
asArrayType()
ResolvedPrimitiveType
asPrimitive()
ResolvedReferenceType
asReferenceType()
ResolvedTypeParameterDeclaration
asTypeParameter()
ResolvedTypeVariable
asTypeVariable()
ResolvedWildcard
asWildcard()
java.lang.String
describe()
ResolvedType
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
isPrimitive()
Is this a primitive type?boolean
isReference()
Is this a non primitive value?boolean
isReferenceType()
Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?boolean
isTypeVariable()
boolean
isVoid()
boolean
isWildcard()
ResolvedType
replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced)
This is like (ResolvedType.replaceTypeVariables(ResolvedTypeParameterDeclaration, ResolvedType, Map)
but ignores the inferred values.ResolvedType
replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, java.util.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 Detail
-
concrete
private ResolvedType concrete
-
provider
private java.util.function.Function<java.lang.Void,ResolvedType> provider
-
-
Constructor Detail
-
LazyType
public LazyType(java.util.function.Function<java.lang.Void,ResolvedType> provider)
-
-
Method Detail
-
getType
public ResolvedType 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
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 java.lang.String describe()
- Specified by:
describe
in interfaceResolvedType
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, java.util.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
-
-