Package io.micronaut.core.annotation
Class AnnotationValueBuilder<T extends Annotation>
java.lang.Object
io.micronaut.core.annotation.AnnotationValueBuilder<T>
- Type Parameters:
T
- The annotation type
A build for annotation values.
- Since:
- 1.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the actualAnnotationValue
.defaultValues
(Map<? extends CharSequence, Object> defaultValues) Sets the default values of the annotation.Sets the given member to the given byte[] value.Sets the given member to the given integer[] value.Sets the given member to the given long[] value.Sets the given member to the given boolean value.Sets the given member to the given boolean value array.Sets the given member to the given byte value.Sets the given member to the given char value.Sets the given member to the given char[] value.Sets the given member to the given double value.Sets the given member to the given double[] value.Sets the given member to the given float value.Sets the given member to the given float[] value.Sets the given member to the given integer value.Sets the given member to the given long value.Sets the given member to the given short value.Sets the given member to the given short[] value.member
(@NonNull String name, @Nullable AnnotationClassValue<?>... classValues) Sets the given member to the given annotation class values.member
(@NonNull String name, @Nullable AnnotationValue<?> annotation) Sets the given member to the given annotation value.member
(@NonNull String name, @Nullable AnnotationValue<?>... annotations) Sets the given member to the given annotation values.Sets the given member to the given type object.Sets the given member to the given type objects.Sets the given member to the given enum object.Sets the given member to the given enum objects.Sets the given member to the given string value.Sets the given member to the given String[] values.members
(@Nullable Map<CharSequence, Object> members) Adds the members from the provided map.removeStereotype
(@NonNull AnnotationValue<?> annotationValueToRemove) Removes the stereotype annotation.replaceStereotype
(@NonNull AnnotationValue<?> originalAnnotationValue, @NonNull AnnotationValue<?> newAnnotationValue) Replaces the stereotype annotation.replaceStereotypes
(@NonNull Collection<AnnotationValue<?>> newStereotypes) Replaces stereotypes of the annotation.stereotype
(AnnotationValue<?> annotation) Adds a stereotype of the annotation.stereotypes
(@NonNull Collection<AnnotationValue<?>> newStereotypes) Adds a stereotypes of the annotation.value
(boolean bool) Sets the value member to the given boolean value.value
(char character) Sets the value member to the given char value.value
(double number) Sets the value member to the given double value.value
(float f) Sets the value member to the given float value.value
(int i) Sets the value member to the given integer value.value
(long i) Sets the value member to the given long value.value
(@Nullable AnnotationValue<?> annotation) Sets the value member to the given annotation value.Sets the value member to the given type object.Sets the value member to the given enum object.Sets the value member to the given string value.values
(@io.micronaut.core.annotation.Nullable int... ints) Sets the value member to the given integer[] value.values
(@io.micronaut.core.annotation.Nullable long... longs) Sets the value member to the given long[] value.values
(@Nullable AnnotationClassValue<?>... types) Sets the value member to the given type objects.values
(@Nullable AnnotationValue<?>... annotations) Sets the value member to the given annotation values.Sets the value member to the given type objects.Sets the value member to the given enum objects.Sets the value member to the given String[] values.
-
Method Details
-
build
Build the actualAnnotationValue
.- Returns:
- The
AnnotationValue
-
stereotype
Adds a stereotype of the annotation.- Parameters:
annotation
- The stereotype- Returns:
- This builder
-
replaceStereotype
@NonNull public @NonNull AnnotationValueBuilder<T> replaceStereotype(@NonNull @NonNull AnnotationValue<?> originalAnnotationValue, @NonNull @NonNull AnnotationValue<?> newAnnotationValue) Replaces the stereotype annotation.- Parameters:
originalAnnotationValue
- The original annotation valuenewAnnotationValue
- The new annotation value- Returns:
- This builder
- Since:
- 4.0.0
-
removeStereotype
@NonNull public @NonNull AnnotationValueBuilder<T> removeStereotype(@NonNull @NonNull AnnotationValue<?> annotationValueToRemove) Removes the stereotype annotation.- Parameters:
annotationValueToRemove
- The annotation value to remove- Returns:
- This builder
- Since:
- 4.0.0
-
stereotypes
@NonNull public @NonNull AnnotationValueBuilder<T> stereotypes(@NonNull @NonNull Collection<AnnotationValue<?>> newStereotypes) Adds a stereotypes of the annotation.- Parameters:
newStereotypes
- The stereotypes- Returns:
- This builder
- Since:
- 4.0.0
-
replaceStereotypes
@NonNull public @NonNull AnnotationValueBuilder<T> replaceStereotypes(@NonNull @NonNull Collection<AnnotationValue<?>> newStereotypes) Replaces stereotypes of the annotation.- Parameters:
newStereotypes
- The stereotypes- Returns:
- This builder
- Since:
- 4.0.0
-
defaultValues
@NonNull public @NonNull AnnotationValueBuilder<T> defaultValues(Map<? extends CharSequence, Object> defaultValues) Sets the default values of the annotation.- Parameters:
defaultValues
- The default values- Returns:
- This builder
-
value
Sets the value member to the given integer value.- Parameters:
i
- The integer- Returns:
- This builder
-
values
@NonNull public @NonNull AnnotationValueBuilder<T> values(@Nullable @io.micronaut.core.annotation.Nullable int... ints) Sets the value member to the given integer[] value.- Parameters:
ints
- The integer[]- Returns:
- This builder
-
value
Sets the value member to the given long value.- Parameters:
i
- The long- Returns:
- This builder
-
values
@NonNull public @NonNull AnnotationValueBuilder<T> values(@Nullable @io.micronaut.core.annotation.Nullable long... longs) Sets the value member to the given long[] value.- Parameters:
longs
- The long[]- Returns:
- This builder
-
value
Sets the value member to the given string value.- Parameters:
str
- The string- Returns:
- This builder
-
values
Sets the value member to the given String[] values.- Parameters:
strings
- The String[]- Returns:
- This builder
-
value
Sets the value member to the given boolean value.- Parameters:
bool
- The boolean- Returns:
- This builder
-
value
Sets the value member to the given char value.- Parameters:
character
- The char- Returns:
- This builder
- Since:
- 3.0.0
-
value
Sets the value member to the given double value.- Parameters:
number
- The double- Returns:
- This builder
- Since:
- 3.0.0
-
value
Sets the value member to the given float value.- Parameters:
f
- The float- Returns:
- This builder
- Since:
- 3.0.0
-
value
Sets the value member to the given enum object.- Parameters:
enumObj
- The enum- Returns:
- This builder
-
values
Sets the value member to the given enum objects.- Parameters:
enumObjs
- The enum[]- Returns:
- This builder
-
value
Sets the value member to the given type object.- Parameters:
type
- The type- Returns:
- This builder
-
values
Sets the value member to the given type objects.- Parameters:
types
- The type[]- Returns:
- This builder
-
values
@NonNull public @NonNull AnnotationValueBuilder<T> values(@Nullable @Nullable AnnotationClassValue<?>... types) Sets the value member to the given type objects.- Parameters:
types
- The type[]- Returns:
- This builder
-
value
@NonNull public @NonNull AnnotationValueBuilder<T> value(@Nullable @Nullable AnnotationValue<?> annotation) Sets the value member to the given annotation value.- Parameters:
annotation
- The annotation- Returns:
- This builder
-
values
@NonNull public @NonNull AnnotationValueBuilder<T> values(@Nullable @Nullable AnnotationValue<?>... annotations) Sets the value member to the given annotation values.- Parameters:
annotations
- The annotation[]- Returns:
- This builder
-
member
Sets the given member to the given integer value.- Parameters:
name
- The name of the memberi
- The integer- Returns:
- This builder
-
member
Sets the given member to the given byte value.- Parameters:
name
- The name of the memberb
- The byte- Returns:
- This builder
- Since:
- 3.0.0
-
member
Sets the given member to the given char value.- Parameters:
name
- The name of the memberc
- The char- Returns:
- This builder
- Since:
- 3.0.0
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, char... chars) Sets the given member to the given char[] value.- Parameters:
name
- The name of the memberchars
- The chars- Returns:
- This builder
- Since:
- 3.0.0
-
member
Sets the given member to the given double value.- Parameters:
name
- The name of the memberd
- The double- Returns:
- This builder
- Since:
- 3.0.0
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, double... doubles) Sets the given member to the given double[] value.- Parameters:
name
- The name of the memberdoubles
- The double[]- Returns:
- This builder
- Since:
- 3.0.0
-
member
Sets the given member to the given float value.- Parameters:
name
- The name of the memberf
- The float- Returns:
- This builder
- Since:
- 3.0.0
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, float... floats) Sets the given member to the given float[] value.- Parameters:
name
- The name of the memberfloats
- The float[]- Returns:
- This builder
- Since:
- 3.0.0
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @io.micronaut.core.annotation.Nullable int... ints) Sets the given member to the given integer[] value.- Parameters:
name
- The name of the memberints
- The integer[]- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @io.micronaut.core.annotation.Nullable byte... bytes) Sets the given member to the given byte[] value.- Parameters:
name
- The name of the memberbytes
- The byte[]- Returns:
- This builder
- Since:
- 3.0.0
-
member
Sets the given member to the given long value.- Parameters:
name
- The name of the memberi
- The long- Returns:
- This builder
-
member
Sets the given member to the given short value.- Parameters:
name
- The name of the memberi
- The short- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, short... shorts) Sets the given member to the given short[] value.- Parameters:
name
- The name of the membershorts
- The short[]- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @io.micronaut.core.annotation.Nullable long... longs) Sets the given member to the given long[] value.- Parameters:
name
- The name of the memberlongs
- The long[]- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable String str) Sets the given member to the given string value.- Parameters:
name
- The name of the memberstr
- The string- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable String... strings) Sets the given member to the given String[] values.- Parameters:
name
- The name of the memberstrings
- The String[]- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, boolean bool) Sets the given member to the given boolean value.- Parameters:
name
- The name of the memberbool
- The boolean- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, boolean... booleans) Sets the given member to the given boolean value array.- Parameters:
name
- The name of the memberbooleans
- The booleans- Returns:
- This builder
- Since:
- 3.0.0
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable Enum<?> enumObj) Sets the given member to the given enum object.- Parameters:
name
- The name of the memberenumObj
- The enum- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable Enum<?>... enumObjs) Sets the given member to the given enum objects.- Parameters:
name
- The name of the memberenumObjs
- The enum[]- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable Class<?> type) Sets the given member to the given type object.- Parameters:
name
- The name of the membertype
- The type- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable Class<?>... types) Sets the given member to the given type objects.- Parameters:
name
- The name of the membertypes
- The type[]- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable AnnotationValue<?> annotation) Sets the given member to the given annotation value.- Parameters:
name
- The name of the memberannotation
- The annotation- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable AnnotationValue<?>... annotations) Sets the given member to the given annotation values.- Parameters:
name
- The name of the memberannotations
- The annotation[]- Returns:
- This builder
-
member
@NonNull public @NonNull AnnotationValueBuilder<T> member(@NonNull @NonNull String name, @Nullable @Nullable AnnotationClassValue<?>... classValues) Sets the given member to the given annotation class values.- Parameters:
name
- The name of the memberclassValues
- The annotation[]- Returns:
- This builder
-
members
@NonNull public @NonNull AnnotationValueBuilder<T> members(@Nullable @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 any of the previous types.- Parameters:
members
- The map of members- Returns:
- This builder
- Since:
- 2.4.0
-