Class Processing

java.lang.Object
io.debezium.operator.docs.Processing

public final class Processing extends Object
  • Constructor Details

    • Processing

      private Processing()
  • Method Details

    • isAnnotated

      public static <A extends Annotation> boolean isAnnotated(Element element, Class<A> annotation)
      Parameters:
      element - potentially annotated element
      annotation - annotation class
      Returns:
      ture if element is annotated, false otherwise
    • annotation

      public static <T extends Annotation> Optional<T> annotation(Element element, Class<T> annotation)
      Parameters:
      element - potentially annotated element
      annotation - annotation class
      Returns:
      annotation instance or empty optional if not present
    • asDeclared

      public static Optional<DeclaredType> asDeclared(TypeMirror type)
      Returns type mirror as instance of DeclaredType when possible
      Parameters:
      type - type mirror instance
      Returns:
      type as DeclaredType or empty
    • asElement

      public static Optional<Element> asElement(TypeMirror type)
      Returns type mirror as instance of Element if type is instance of DeclaredType
      Parameters:
      type - type mirror instance
      Returns:
      type as Element or empty
    • asTypeElement

      public static Optional<TypeElement> asTypeElement(TypeMirror type, ElementKind kind)
      Return type mirror as TypeElement if it represents specified kind
      Parameters:
      type - type mirror instance
      kind - element kind
      Returns:
      type mirror as TypeElement or empty
    • asEnum

      public static Optional<TypeElement> asEnum(TypeMirror type)
      Return type mirror as TypeElement if it represents an Enum type
      Parameters:
      type - type mirror instance
      Returns:
      type mirror as TypeElement or empty
    • enclosedElements

      public static <T extends Element> Stream<T> enclosedElements(TypeElement element, ElementKind kind, Class<T> clazz)
      Filters enclosed elements by kind
      Parameters:
      element - parent element
      Returns:
      stream of enclosed elements cast to given type
    • enclosedElements

      public static Stream<? extends Element> enclosedElements(TypeElement element, ElementKind kind)
      Filters enclosed elements by kind
      Parameters:
      element - parent element
      Returns:
      stream of enclosed elements
    • enclosedElements

      public static Stream<? extends Element> enclosedElements(TypeElement element)
      Parameters:
      element - parent element
      Returns:
      stream of enclosed elements
    • parent

      public static TypeElement parent(TypeElement element)
      Returns parent class of given element
      Parameters:
      element - the type element
      Returns:
      parent or null in case that the parent is Object
    • typeArguments

      public static Stream<? extends TypeMirror> typeArguments(DeclaredType type)
    • typeArguments

      public static <T> Stream<T> typeArguments(DeclaredType type, Function<TypeMirror,T> mapper)