Class GeneratedAnnotations


  • public final class GeneratedAnnotations
    extends Object
    Utility methods for writing @Generated annotations.
    • Method Detail

      • generatedAnnotation

        public static Optional<TypeElement> generatedAnnotation​(Elements elements,
                                                                SourceVersion sourceVersion)
        Returns the element corresponding to the @Generated annotation present at the target SourceVersion.

        Returns javax.annotation.processing.Generated for JDK 9 and newer, javax.annotation.Generated for earlier releases, and Optional#empty()} if the annotation is not available.