Package dev.objz.commandbridge.api
Class CommandBridgeProvider
java.lang.Object
dev.objz.commandbridge.api.CommandBridgeProvider
Static provider for accessing the
CommandBridgeAPI instance.-
Method Summary
Modifier and TypeMethodDescriptionstatic CommandBridgeAPIget()static <T extends CommandBridgeAPI>
TObtains the API instance cast to a specific type.static voidregister(CommandBridgeAPI impl) Registers the API implementation.static voidUnregisters the current API implementation.
-
Method Details
-
get
- Returns:
- the registered API instance
- Throws:
IllegalStateException- if the API is not registered
-
get
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
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.
-