Class ResolvedIntersectionType
- java.lang.Object
-
- com.github.javaparser.resolution.types.ResolvedIntersectionType
-
- All Implemented Interfaces:
ResolvedType
public class ResolvedIntersectionType extends Object implements ResolvedType
An intersection type is defined in java as list of types separates by ampersands.- Author:
- Federico Tomassetti
-
-
Constructor Summary
Constructors Constructor Description ResolvedIntersectionType(Collection<ResolvedType> elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
describe()
boolean
equals(Object o)
int
hashCode()
boolean
isAssignableBy(ResolvedType other)
This method checks if ThisType t = new OtherType() would compile.ResolvedType
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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.resolution.types.ResolvedType
arrayLevel, asArrayType, asConstraintType, asPrimitive, asReferenceType, asTypeParameter, asTypeVariable, asUnionType, asWildcard, isArray, isConstraint, isNull, isPrimitive, isReference, isReferenceType, isTypeVariable, isUnionType, isVoid, isWildcard, mention, replaceTypeVariables
-
-
-
-
Constructor Detail
-
ResolvedIntersectionType
public ResolvedIntersectionType(Collection<ResolvedType> elements)
-
-
Method Detail
-
describe
public String describe()
- Specified by:
describe
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
-
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
-
-