Module java.compiler

Interface IntersectionType

所有超接口:
AnnotatedConstruct, TypeMirror

public interface IntersectionType extends TypeMirror
表示一个交集类型。

交集类型可以在程序中隐式或显式声明。例如,类型参数 <T extends Number & Runnable> 的边界是一个(隐式)交集类型。这由一个带有 NumberRunnable 作为其边界的 IntersectionType 表示。

实现注意:
在参考实现中,IntersectionType 用于模拟强制类型转换表达式的显式目标类型。
自从:
1.8
  • Method Details

    • getBounds

      List<? extends TypeMirror> getBounds()
      返回组成此交集类型的边界。
      返回:
      组成此交集类型的边界