Class AnnotationValueBuilder<T extends Annotation>

java.lang.Object
io.micronaut.core.annotation.AnnotationValueBuilder<T>
Type Parameters:
T - The annotation type

public class AnnotationValueBuilder<T extends Annotation> extends Object
A build for annotation values.
Since:
1.0
Author:
graemerocher
  • Method Details

    • build

      public AnnotationValue<T> build()
      Build the actual AnnotationValue.
      Returns:
      The AnnotationValue
    • stereotype

      public AnnotationValueBuilder<T> stereotype(AnnotationValue<?> annotation)
      Adds a stereotype of the annotation.
      Parameters:
      annotation - The stereotype
      Returns:
      This builder
    • replaceStereotype

      public AnnotationValueBuilder<T> replaceStereotype(AnnotationValue<?> originalAnnotationValue, AnnotationValue<?> newAnnotationValue)
      Replaces the stereotype annotation.
      Parameters:
      originalAnnotationValue - The original annotation value
      newAnnotationValue - The new annotation value
      Returns:
      This builder
      Since:
      4.0.0
    • removeStereotype

      public AnnotationValueBuilder<T> removeStereotype(AnnotationValue<?> annotationValueToRemove)
      Removes the stereotype annotation.
      Parameters:
      annotationValueToRemove - The annotation value to remove
      Returns:
      This builder
      Since:
      4.0.0
    • stereotypes

      public AnnotationValueBuilder<T> stereotypes(Collection<AnnotationValue<?>> newStereotypes)
      Adds a stereotypes of the annotation.
      Parameters:
      newStereotypes - The stereotypes
      Returns:
      This builder
      Since:
      4.0.0
    • replaceStereotypes

      public AnnotationValueBuilder<T> replaceStereotypes(Collection<AnnotationValue<?>> newStereotypes)
      Replaces stereotypes of the annotation.
      Parameters:
      newStereotypes - The stereotypes
      Returns:
      This builder
      Since:
      4.0.0
    • defaultValues

      public AnnotationValueBuilder<T> defaultValues(Map<? extends CharSequence,Object> defaultValues)
      Sets the default values of the annotation.
      Parameters:
      defaultValues - The default values
      Returns:
      This builder
    • value

      public AnnotationValueBuilder<T> value(int i)
      Sets the value member to the given integer value.
      Parameters:
      i - The integer
      Returns:
      This builder
    • values

      public AnnotationValueBuilder<T> values(int @Nullable ... ints)
      Sets the value member to the given integer[] value.
      Parameters:
      ints - The integer[]
      Returns:
      This builder
    • value

      public AnnotationValueBuilder<T> value(long i)
      Sets the value member to the given long value.
      Parameters:
      i - The long
      Returns:
      This builder
    • values

      public AnnotationValueBuilder<T> values(long @Nullable ... longs)
      Sets the value member to the given long[] value.
      Parameters:
      longs - The long[]
      Returns:
      This builder
    • value

      public AnnotationValueBuilder<T> value(@Nullable String str)
      Sets the value member to the given string value.
      Parameters:
      str - The string
      Returns:
      This builder
    • values

      public AnnotationValueBuilder<T> values(String @Nullable ... strings)
      Sets the value member to the given String[] values.
      Parameters:
      strings - The String[]
      Returns:
      This builder
    • value

      public AnnotationValueBuilder<T> value(boolean bool)
      Sets the value member to the given boolean value.
      Parameters:
      bool - The boolean
      Returns:
      This builder
    • value

      public AnnotationValueBuilder<T> value(char character)
      Sets the value member to the given char value.
      Parameters:
      character - The char
      Returns:
      This builder
      Since:
      3.0.0
    • value

      public AnnotationValueBuilder<T> value(double number)
      Sets the value member to the given double value.
      Parameters:
      number - The double
      Returns:
      This builder
      Since:
      3.0.0
    • value

      public AnnotationValueBuilder<T> value(float f)
      Sets the value member to the given float value.
      Parameters:
      f - The float
      Returns:
      This builder
      Since:
      3.0.0
    • value

      public AnnotationValueBuilder<T> value(@Nullable Enum<?> enumObj)
      Sets the value member to the given enum object.
      Parameters:
      enumObj - The enum
      Returns:
      This builder
    • values

      public AnnotationValueBuilder<T> values(Enum<?> @Nullable ... enumObjs)
      Sets the value member to the given enum objects.
      Parameters:
      enumObjs - The enum[]
      Returns:
      This builder
    • value

      public AnnotationValueBuilder<T> value(Class<?> type)
      Sets the value member to the given type object.
      Parameters:
      type - The type
      Returns:
      This builder
    • values

      public AnnotationValueBuilder<T> values(Class<?> @Nullable ... types)
      Sets the value member to the given type objects.
      Parameters:
      types - The type[]
      Returns:
      This builder
    • values

      public AnnotationValueBuilder<T> values(AnnotationClassValue<?> @Nullable ... types)
      Sets the value member to the given type objects.
      Parameters:
      types - The type[]
      Returns:
      This builder
    • value

      public AnnotationValueBuilder<T> value(@Nullable AnnotationValue<?> annotation)
      Sets the value member to the given annotation value.
      Parameters:
      annotation - The annotation
      Returns:
      This builder
    • values

      public AnnotationValueBuilder<T> values(AnnotationValue<?> @Nullable ... annotations)
      Sets the value member to the given annotation values.
      Parameters:
      annotations - The annotation[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, int i)
      Sets the given member to the given integer value.
      Parameters:
      name - The name of the member
      i - The integer
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, byte b)
      Sets the given member to the given byte value.
      Parameters:
      name - The name of the member
      b - The byte
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, char c)
      Sets the given member to the given char value.
      Parameters:
      name - The name of the member
      c - The char
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, char... chars)
      Sets the given member to the given char[] value.
      Parameters:
      name - The name of the member
      chars - The chars
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, double d)
      Sets the given member to the given double value.
      Parameters:
      name - The name of the member
      d - The double
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, double... doubles)
      Sets the given member to the given double[] value.
      Parameters:
      name - The name of the member
      doubles - The double[]
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, float f)
      Sets the given member to the given float value.
      Parameters:
      name - The name of the member
      f - The float
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, float... floats)
      Sets the given member to the given float[] value.
      Parameters:
      name - The name of the member
      floats - The float[]
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, int @Nullable ... ints)
      Sets the given member to the given integer[] value.
      Parameters:
      name - The name of the member
      ints - The integer[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, byte @Nullable ... bytes)
      Sets the given member to the given byte[] value.
      Parameters:
      name - The name of the member
      bytes - The byte[]
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, long i)
      Sets the given member to the given long value.
      Parameters:
      name - The name of the member
      i - The long
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, short i)
      Sets the given member to the given short value.
      Parameters:
      name - The name of the member
      i - The short
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, short... shorts)
      Sets the given member to the given short[] value.
      Parameters:
      name - The name of the member
      shorts - The short[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, long @Nullable ... longs)
      Sets the given member to the given long[] value.
      Parameters:
      name - The name of the member
      longs - The long[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, @Nullable String str)
      Sets the given member to the given string value.
      Parameters:
      name - The name of the member
      str - The string
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, String @Nullable ... strings)
      Sets the given member to the given String[] values.
      Parameters:
      name - The name of the member
      strings - The String[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, boolean bool)
      Sets the given member to the given boolean value.
      Parameters:
      name - The name of the member
      bool - The boolean
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, boolean... booleans)
      Sets the given member to the given boolean value array.
      Parameters:
      name - The name of the member
      booleans - The booleans
      Returns:
      This builder
      Since:
      3.0.0
    • member

      public AnnotationValueBuilder<T> member(String name, @Nullable Enum<?> enumObj)
      Sets the given member to the given enum object.
      Parameters:
      name - The name of the member
      enumObj - The enum
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, Enum<?> @Nullable ... enumObjs)
      Sets the given member to the given enum objects.
      Parameters:
      name - The name of the member
      enumObjs - The enum[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, @Nullable Class<?> type)
      Sets the given member to the given type object.
      Parameters:
      name - The name of the member
      type - The type
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, Class<?> @Nullable ... types)
      Sets the given member to the given type objects.
      Parameters:
      name - The name of the member
      types - The type[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, @Nullable AnnotationValue<?> annotation)
      Sets the given member to the given annotation value.
      Parameters:
      name - The name of the member
      annotation - The annotation
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, AnnotationValue<?> @Nullable ... annotations)
      Sets the given member to the given annotation values.
      Parameters:
      name - The name of the member
      annotations - The annotation[]
      Returns:
      This builder
    • member

      public AnnotationValueBuilder<T> member(String name, AnnotationClassValue<?> @Nullable ... classValues)
      Sets the given member to the given annotation class values.
      Parameters:
      name - The name of the member
      classValues - The annotation[]
      Returns:
      This builder
    • members

      public AnnotationValueBuilder<T> members(@Nullable Map<CharSequence,Object> members)
      Adds the members from the provided map. All values must be primitives, enums, strings, annotation values, or an array of the previous types.
      Parameters:
      members - The map of members
      Returns:
      This builder
      Since:
      2.4.0