Class AnnotationFactory
java.lang.Object
studio.mevera.imperat.annotations.base.AnnotationFactory
A class that is responsible for creating
dynamic instances of annotations of certain types
useful while implementing/using
AnnotationReplacer-
Constructor Summary
Constructors -
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
-
AnnotationFactory
public AnnotationFactory()
-
-
Method Details
-
create
Creates a new annotation with no values. Any default values will automatically be used.- Type Parameters:
T- Annotation valueType- Parameters:
type- The annotation valueType- 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
Suppliers instead of direct values.- Type Parameters:
T- Annotation valueType- Parameters:
type- The annotation valueTypemembers- 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
Suppliers instead of direct values.- Type Parameters:
T- Annotation valueType- Parameters:
type- The annotation valueType- Returns:
- The newly created annotation
-