Interface Capabilities
public interface Capabilities
What the unified API supports on the server this plugin runs on. Available as
ctx.capabilities.
if (!ctx.capabilities.supports(Capability.BANK_WITHDRAW)) {
log.warn("No bank withdraw on {}: {}", ctx.server(), ctx.capabilities.note(Capability.BANK_WITHDRAW));
return;
}
A capability nobody has evidence for is Support.UNKNOWN, never Support.UNSUPPORTED.
supports is true only for Support.SUPPORTED and Support.PARTIAL; a plugin that wants
to try an unknown verb anyway should check support(c) != Support.UNSUPPORTED instead.
-
Method Summary
Modifier and TypeMethodDescriptionnote(Capability capability) What a plugin author needs to know about this capability here: which cases work for a partial one, why an unsupported one fails, or that nothing is known.server()The server these answers are for.support(Capability capability) The recorded support level;Support.UNKNOWNwhen nothing is recorded.default booleansupports(Capability capability)
-
Method Details
-
server
ServerId server()The server these answers are for. -
support
The recorded support level;Support.UNKNOWNwhen nothing is recorded. Never null. -
supports
-
note
What a plugin author needs to know about this capability here: which cases work for a partial one, why an unsupported one fails, or that nothing is known. Never null; empty only when there is nothing to add.
-