public interface CapabilityService
registerEnableListener(Consumer)
to be notified of Plan reloads
hasCapability(String)
to check if a capability is available.
See Capability
for list of capabilities provided by the current version.
Modifier and Type | Interface and Description |
---|---|
static class |
CapabilityService.ListHolder |
Modifier and Type | Method and Description |
---|---|
static CapabilityService |
getInstance()
Obtain instance of CapabilityService.
|
default boolean |
hasCapability(java.lang.String capabilityName)
Check if the API on the current version provides a capability.
|
default void |
registerEnableListener(java.util.function.Consumer<java.lang.Boolean> isEnabledListener)
Register a method to be called when Plan reloads.
|
static CapabilityService getInstance()
java.lang.NoClassDefFoundError
- If Plan is not installed and this class can not be found or if older Plan version is installed.java.lang.IllegalStateException
- If Plan is installed, but not enabled.default void registerEnableListener(java.util.function.Consumer<java.lang.Boolean> isEnabledListener)
isEnabledListener
- The boolean given to the method tells if Plan has enabled successfully.default boolean hasCapability(java.lang.String capabilityName)
capabilityName
- Name of a capabilityfor different capabilityNames.