Interface AnnotationCreator<A extends Annotation>

Type Parameters:
A - the annotation type

public sealed interface AnnotationCreator<A extends Annotation>
A typesafe creator for an annotation body.
  • Method Details

    • from

      static <A extends Annotation> Consumer<AnnotationCreator<A>> from(A annotation)
      Get an annotation builder which adds the given annotation to its given creator. The builder may be used more than once.
      Type Parameters:
      A - the annotation type
      Parameters:
      annotation - the annotation to copy (must not be null)
      Returns:
      the annotation builder (not null)
    • add

      void add(String name, boolean value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.BooleanProperty<A> prop, boolean value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, byte value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.ByteProperty<A> prop, byte value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, short value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.ShortProperty<A> prop, short value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, int value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.IntProperty<A> prop, int value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, long value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.LongProperty<A> prop, long value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, float value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.FloatProperty<A> prop, float value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, double value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.DoubleProperty<A> prop, double value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, char value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value
    • add

      void add(AnnotationCreator.CharProperty<A> prop, char value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, String value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value (must not be null)
    • add

      void add(AnnotationCreator.StringProperty<A> prop, String value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, Class<?> value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value (must not be null)
    • add

      void add(AnnotationCreator.ClassProperty<A> prop, Class<?> value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, ClassDesc value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value (must not be null)
    • add

      void add(AnnotationCreator.ClassProperty<A> prop, ClassDesc value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      <E extends Enum<E>> void add(String name, E value)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      value - the property value (must not be null)
    • add

      <E extends Enum<E>> void add(AnnotationCreator.EnumProperty<A,E> prop, E value)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      value - the property value
    • add

      void add(String name, ClassDesc enumClass, String enumConstant)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      enumClass - the enum class
      enumConstant - the name of the enum constant
    • add

      <S extends Annotation> void add(String name, Class<S> annotationClass, Consumer<AnnotationCreator<S>> builder)
      Add an annotation property with the given name and built value.
      Type Parameters:
      S - the annotation type
      Parameters:
      name - the property name (must not be null)
      annotationClass - the class of the nested annotation (must not be null)
      builder - the builder for the nested annotation (must not be null)
    • add

      <S extends Annotation> void add(AnnotationCreator.AnnotationProperty<A,S> prop, Consumer<AnnotationCreator<S>> builder)
      Add an annotation property for the given method and built value.
      Type Parameters:
      S - the annotation type
      Parameters:
      prop - the annotation property method (must not be null)
      builder - the builder for the nested annotation (must not be null)
    • add

      void add(String name, ClassDesc annotationClass, Consumer<AnnotationCreator<Annotation>> builder)
      Add an annotation property with the given name and built value.
      Parameters:
      name - the property name (must not be null)
      annotationClass - the class of the nested annotation (must not be null)
      builder - the builder for the nested annotation (must not be null)
    • addArray

      void addArray(String name, boolean... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.BooleanArrayProperty<A> prop, boolean... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, byte... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.ByteArrayProperty<A> prop, byte... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, short... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.ShortArrayProperty<A> prop, short... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, int... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.IntArrayProperty<A> prop, int... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, long... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.LongArrayProperty<A> prop, long... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, float... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.FloatArrayProperty<A> prop, float... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, double... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.DoubleArrayProperty<A> prop, double... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, char... values)
      Add an annotation property for the given method and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.CharArrayProperty<A> prop, char... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, String... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.StringArrayProperty<A> prop, String... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, Class<?>... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.ClassArrayProperty<A> prop, Class<?>... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, ClassDesc... values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(AnnotationCreator.ClassArrayProperty<A> prop, ClassDesc... values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      <E extends Enum<E>> void addArray(String name, List<E> values)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      values - the property values (must not be null)
    • addArray

      <E extends Enum<E>> void addArray(AnnotationCreator.EnumArrayProperty<A,E> prop, List<E> values)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      values - the property values (must not be null)
    • addArray

      void addArray(String name, ClassDesc enumClass, String... enumConstants)
      Add an annotation property with the given name and value.
      Parameters:
      name - the property name (must not be null)
      enumClass - the enum class (must not be null)
      enumConstants - the enum constants (must not be null)
    • addArray

      <E extends Enum<E>> void addArray(AnnotationCreator.EnumArrayProperty<A,E> prop, ClassDesc enumClass, String... enumConstants)
      Add an annotation property for the given method and value.
      Parameters:
      prop - the property method (must not be null)
      enumClass - the enum class (must not be null)
      enumConstants - the enum constants (must not be null)
    • addArray

      <S extends Annotation> void addArray(String name, Class<S> annotationClass, List<Consumer<AnnotationCreator<S>>> builders)
      Add an annotation property with the given name and built values.
      Type Parameters:
      S - the annotation type
      Parameters:
      name - the property name (must not be null)
      annotationClass - the class of the nested annotation (must not be null)
      builders - the builders for the nested annotations (must not be null)
    • addArray

      <S extends Annotation> void addArray(AnnotationCreator.AnnotationArrayProperty<A,S> prop, List<Consumer<AnnotationCreator<S>>> builders)
      Add an annotation property for the given method and built values.
      Type Parameters:
      S - the annotation type
      Parameters:
      prop - the annotation property method (must not be null)
      builders - the builders for the nested annotations (must not be null)
    • addArray

      void addArray(String name, ClassDesc annotationClass, List<Consumer<AnnotationCreator<Annotation>>> builders)
      Add an annotation property with the given name and built values.
      Parameters:
      name - the property name (must not be null)
      annotationClass - the class of the nested annotation (must not be null)
      builders - the builders for the nested annotations (must not be null)