Class CommandBridgeProvider

java.lang.Object
dev.objz.commandbridge.api.CommandBridgeProvider

public final class CommandBridgeProvider extends Object
Static provider for accessing the CommandBridgeAPI instance.
  • Method Details

    • get

      public static CommandBridgeAPI get()
      Returns:
      the registered API instance
      Throws:
      IllegalStateException - if the API is not registered
    • get

      public static <T extends CommandBridgeAPI> T get(Class<T> type)
      Obtains the API instance cast to a specific type.
      Type Parameters:
      T - the API type
      Parameters:
      type - the API class type
      Returns:
      the cast API instance
      Throws:
      IllegalStateException - if the instance is not available or compatible
    • register

      public static void register(CommandBridgeAPI impl)
      Registers the API implementation.
      Parameters:
      impl - the implementation to register
      Throws:
      IllegalStateException - if an implementation is already registered
    • unregister

      public static void unregister()
      Unregisters the current API implementation.