Class ResolvedUnionType
- java.lang.Object
-
- com.github.javaparser.resolution.types.ResolvedUnionType
-
- All Implemented Interfaces:
ResolvedType
public class ResolvedUnionType extends Object implements ResolvedType
A union type is defined in java as list of types separates by pipes.- Author:
- Federico Tomassetti
-
-
Constructor Summary
Constructors Constructor Description ResolvedUnionType(List<ResolvedType> elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedUnionTypeasUnionType()Stringdescribe()booleanequals(Object o)Optional<ResolvedReferenceType>getCommonAncestor()List<ResolvedType>getElements()inthashCode()booleanisAssignableBy(ResolvedType other)This method checks if ThisType t = new OtherType() would compile.booleanisUnionType()Is this a union type (as the ones used in multi catch clauses)?-
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, asWildcard, erasure, isArray, isConstraint, isInferenceVariable, isNull, isNumericType, isPrimitive, isReference, isReferenceType, isTypeVariable, isVoid, isWildcard, mention, replaceTypeVariables, replaceTypeVariables, solveGenericTypes, toDescriptor
-
-
-
-
Constructor Detail
-
ResolvedUnionType
public ResolvedUnionType(List<ResolvedType> elements)
-
-
Method Detail
-
getCommonAncestor
public Optional<ResolvedReferenceType> getCommonAncestor()
-
describe
public String describe()
- Specified by:
describein 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
-
isUnionType
public boolean isUnionType()
Description copied from interface:ResolvedTypeIs this a union type (as the ones used in multi catch clauses)?- Specified by:
isUnionTypein interfaceResolvedType
-
asUnionType
public ResolvedUnionType asUnionType()
- Specified by:
asUnionTypein interfaceResolvedType
-
getElements
public List<ResolvedType> getElements()
-
-