Enum Class Capability
- All Implemented Interfaces:
Serializable,Comparable<Capability>,java.lang.constant.Constable
NONE sentinel for protocol-level messages.
Each config-backed constant owns its own ultipanel.capabilities.* key, its own D-08
shipped default, and the comment lines the capability migration attaches when it writes the key
for the first time. isEnabled() is the single config read every inbound and outbound
capability gate in this phase consults — see PluginInitiationUtils.handleInboundMessage.
- Since:
- 6.3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe D-10 sentinel for protocol-level and echo messages that carry no operator-facing policy. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCapability(String configKey, boolean defaultEnabled, List<String> commentLines) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe literal config-key prefix every capability lives under inconfig.yml.static StringconfigurableRefusal(String configKey) A refusal sentence for a capability whose gate an operator CAN change through configuration.The explanatory comment lines the capability migration attaches when it writes this key for the first time.This capability's config key suffix (e.g.The full dotted config path for this capability.booleanThe D-08 shipped default this capability resolves to when its key is absent fromconfig.yml.booleanWhether this capability is currently enabled.static StringnonConfigurableRefusal(String reason) A refusal sentence for a restriction no configuration can lift.This capability's own refusal message, naming its config path.static CapabilityReturns the enum constant of this class with the specified name.static Capability[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MONITORING
-
LOGS
-
PLAYER_EVENTS
-
FILE_READ
-
FILE_WRITE
-
FILE_DELETE
-
COMMANDS
-
SERVER_PROPERTIES
-
NONE
The D-10 sentinel for protocol-level and echo messages that carry no operator-facing policy. Never written to config.yml and never gated —isEnabled()always returnstruewithout touching config.
-
-
Field Details
-
configKey
-
defaultEnabled
private final boolean defaultEnabled -
commentLines
-
-
Constructor Details
-
Capability
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
configBasePath
The literal config-key prefix every capability lives under inconfig.yml.- Returns:
"ultipanel.capabilities."
-
getConfigKey
This capability's config key suffix (e.g."commands").- Returns:
- the config key suffix, or
nullforNONE
-
getDefaultEnabled
public boolean getDefaultEnabled()The D-08 shipped default this capability resolves to when its key is absent fromconfig.yml.- Returns:
- the shipped default
-
getCommentLines
The explanatory comment lines the capability migration attaches when it writes this key for the first time. English first with Chinese as supplement.- Returns:
- an unmodifiable list of comment lines
-
getConfigPath
The full dotted config path for this capability.- Returns:
- e.g.
"ultipanel.capabilities.commands"
-
isEnabled
public boolean isEnabled()Whether this capability is currently enabled.Never throws and never propagates a config-read failure — modelled on
ErrorReportCollector.loadConfiguration()'s try/catch shape. WhenUltiTools.getInstance()isnullor its config is unavailable, this returns the constant's owngetDefaultEnabled()rather than a swallowedNullPointerException, so a test harness without a live config sees shipped behaviour. Not cached — the operator may reload config.- Returns:
trueif this capability is enabled
-
configurableRefusal
A refusal sentence for a capability whose gate an operator CAN change through configuration. Names the exact key and file, per D-05/D-13/D-17. This andnonConfigurableRefusal(java.lang.String)are the single source of refusal wording for the whole phase — callers must not format their own refusal strings.- Parameters:
configKey- the full dotted config path that would flip this refusal- Returns:
- the refusal sentence
-
nonConfigurableRefusal
A refusal sentence for a restriction no configuration can lift. States plainly that it cannot be changed, per D-17's requirement that the two refusal causes never collapse into one sentence.- Parameters:
reason- why the restriction exists- Returns:
- the refusal sentence
-
refusalMessage
This capability's own refusal message, naming its config path.- Returns:
- the refusal sentence produced by
configurableRefusal(String)for this capability's own config path
-