Interface AnnotationAware


@Beta public interface AnnotationAware
Interface mixin for BindingObjects which can hold additional metadata, as specified by RFC7952. It exposes this metadata as individual annotations via annotation(Class) method. This similar to how Augmentable works, with the notable difference that there is no strong tie between an annotation and its bearer object.
  • Method Summary

    Modifier and Type
    Method
    Description
    <A$$ extends Annotation<?>>
    Optional<A$$>
    annotation(Class<A$$> annotationType)
    Returns an instance of a requested annotation type.
  • Method Details

    • annotation

      <A$$ extends Annotation<?>> Optional<A$$> annotation(Class<A$$> annotationType)
      Returns an instance of a requested annotation type.
      Type Parameters:
      A$$ - Type capture for augmentation type
      Parameters:
      annotationType - Type of annotation to be returned.
      Returns:
      instance of annotation, or empty if the annotation is not present.