Class Annotations
java.lang.Object
revxrsal.commands.annotation.dynamic.Annotations
A utility for constructing annotations dynamically.
Re-adapted from Guice.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Annotation>
TCreates a new annotation with no values.static <T extends Annotation>
TCreates a new annotation with the given map values.static <T extends Annotation>
TCreates a new annotation with the given map values.
-
Constructor Details
-
Annotations
public Annotations()
-
-
Method Details
-
create
Creates a new annotation with no values. Any default values will automatically be used.- Type Parameters:
T
- Annotation type- Parameters:
type
- The annotation type- Returns:
- The newly created annotation
-
create
@NotNull public static <T extends Annotation> T create(@NotNull @NotNull Class<T> type, @NotNull @NotNull Map<String, Object> members) Creates a new annotation with the given map values. Any default values will automatically be used if not specified in the map.Note that the map may also use
Supplier
s instead of direct values.- Type Parameters:
T
- Annotation type- Parameters:
type
- The annotation typemembers
- The annotation members- Returns:
- The newly created annotation
-
create
@NotNull public static <T extends Annotation> T create(@NotNull @NotNull Class<T> type, @NotNull @NotNull Object... members) Creates a new annotation with the given map values. Any default values will automatically be used if not specified in the map.Note that the map may also use
Supplier
s instead of direct values.- Type Parameters:
T
- Annotation type- Parameters:
type
- The annotation type- Returns:
- The newly created annotation
-