Package com.djrapitops.plan.capability
Interface CapabilityService
public interface CapabilityService
Service for figuring out provided API capabilities.
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.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CapabilityService
Obtain instance of CapabilityService.default boolean
hasCapability
(String capabilityName) Check if the API on the current version provides a capability.default void
registerEnableListener
(Consumer<Boolean> isEnabledListener) Register a method to be called when Plan reloads.
-
Method Details
-
getInstance
Obtain instance of CapabilityService.- Returns:
- CapabilityService implementation.
- Throws:
NoClassDefFoundError
- If Plan is not installed and this class can not be found or if older Plan version is installed.IllegalStateException
- If Plan is installed, but not enabled.
-
registerEnableListener
Register a method to be called when Plan reloads.- Parameters:
isEnabledListener
- The boolean given to the method tells if Plan has enabled successfully.
-
hasCapability
Check if the API on the current version provides a capability.- Parameters:
capabilityName
- Name of a capability- Returns:
- true if the capability is available.
- See Also:
-
for different capabilityNames.
-