Interface CapabilityService

All Known Implementing Classes:
CapabilitySvc

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.

  • Method Details

    • getInstance

      static CapabilityService 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

      default void registerEnableListener(Consumer<Boolean> isEnabledListener)
      Register a method to be called when Plan reloads.
      Parameters:
      isEnabledListener - The boolean given to the method tells if Plan has enabled successfully.
    • hasCapability

      default boolean hasCapability(String capabilityName)
      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.