Class GestaltSupplier

java.lang.Object
ovh.mythmc.gestalt.GestaltSupplier

public final class GestaltSupplier extends Object
Static holder for the active Gestalt instance.

The instance can be set exactly once via set(Gestalt); subsequent calls will throw an AlreadyInitializedException. The stored instance is retrieved via get().

  • Constructor Details

    • GestaltSupplier

      public GestaltSupplier()
  • Method Details

    • set

      public static void set(@NotNull @NotNull Gestalt g)
      Sets the active Gestalt instance.
      Parameters:
      g - the Gestalt instance to register
      Throws:
      AlreadyInitializedException - if a Gestalt instance has already been set
    • get

      @NotNull public static @NotNull Gestalt get()
      Returns the active Gestalt instance.
      Returns:
      the active Gestalt instance