Class ResolvedIntersectionType
- java.lang.Object
-
- com.github.javaparser.resolution.types.ResolvedIntersectionType
-
- All Implemented Interfaces:
ResolvedType
public class ResolvedIntersectionType extends java.lang.Object implements ResolvedType
An intersection type is defined in java as list of types separates by ampersands.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ResolvedType>
elements
-
Constructor Summary
Constructors Constructor Description ResolvedIntersectionType(java.util.Collection<ResolvedType> elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
describe()
boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isAssignableBy(ResolvedType other)
This method checks if ThisType t = new OtherType() would compile.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, 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
-
-
-
-
Field Detail
-
elements
private java.util.List<ResolvedType> elements
-
-
Constructor Detail
-
ResolvedIntersectionType
public ResolvedIntersectionType(java.util.Collection<ResolvedType> elements)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
describe
public java.lang.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, 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
-
-