Interface CtIntersectionTypeReference<T>

All Superinterfaces:
Cloneable, CtActualTypeContainer, CtElement, CtQueryable, CtReference, CtShadowable, CtTypeInformation, CtTypeReference<T>, CtVisitable, FactoryAccessor, Serializable, SourcePositionHolder
All Known Implementing Classes:
CtIntersectionTypeReferenceImpl

public interface CtIntersectionTypeReference<T> extends CtTypeReference<T>
This interface defines a reference to an intersection type in generics or in casts.
  • Method Details

    • getBounds

      List<CtTypeReference<?>> getBounds()
      Gets the bounds of the intersection type. Note that the first bound correspond to the current intersection type.
           T extends Interface1 & Interface2 // CtTypeParameterReference#getBoundingType == Interface1 and getBounds().get(0) == Interface1
       
    • setBounds

      <C extends CtIntersectionTypeReference> C setBounds(List<CtTypeReference<?>> bounds)
      Sets the bounds of the intersection type.
    • addBound

      <C extends CtIntersectionTypeReference> C addBound(CtTypeReference<?> bound)
      Adds a bound.
    • removeBound

      boolean removeBound(CtTypeReference<?> bound)
      Removes a bound.
    • clone

      Description copied from interface: CtElement
      Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methods Refactoring.copyType(CtType) and Refactoring.copyMethod(CtMethod) instead which does additional work beyond cloning.
      Specified by:
      clone in interface CtElement
      Specified by:
      clone in interface CtReference
      Specified by:
      clone in interface CtTypeReference<T>
      Returns:
      a clone of this element. All children are cloned, but the parent of the returned clone is set to null.