Class AnnotationFactory

java.lang.Object
studio.mevera.imperat.annotations.base.AnnotationFactory

@AvailableSince("1.0.0") public final class AnnotationFactory extends Object
A class that is responsible for creating dynamic instances of annotations of certain types useful while implementing/using AnnotationReplacer
  • Constructor Details

    • AnnotationFactory

      public AnnotationFactory()
  • Method Details

    • create

      @NotNull public static <T extends Annotation> T create(@NotNull @NotNull Class<T> type)
      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 valueType
      members - 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