Skip to content

Option ​

com.jsmacrosce.jsmacros.core.config.Option

Configures how an annotated configuration field or method is presented in the settings editor.

js
const Config = Java.type("com.jsmacrosce.jsmacros.core.config.CoreConfigV2");  
const Option = Java.type("com.jsmacrosce.jsmacros.core.config.Option");  
const metadata = Config.class.getField("maxLockTime").getAnnotation(Option.class);  
Chat.log(metadata.translationKey() + ": " + metadata.type().value());

Methods ​

getter ​

getter(): String#
Returns the declared no-argument getter method name for an annotated field, or empty to read that field directly. An annotated method is used as the getter regardless of this element.
Returns: getter method name, or empty when none is specified

group ​

group(): String[]#
Returns the ordered category path in which the setting appears.
Returns: category path segments

options ​

options(): String#
Returns the declared no-argument method name supplying choices for the setting, or empty when no provider is specified. The named method returns a List of choices. Without a provider, enum settings use their constants; non-enum settings have no choices.
Returns: choice-provider method name, or empty when none is specified

setter ​

setter(): String#
Returns the declared setter method name, or empty to use direct field assignment for an annotated field. A named setter takes one argument matching the annotated field type or, for an annotated method, its return type.
Returns: setter method name, or empty when none is specified

translationKey ​

translationKey(): String#
Returns the translation key used for the setting's label.
Returns: the label translation key

type ​

type(): OptionType#
Returns the setting editor kind and its kind-specific metadata.
Returns: editor-kind and option metadata; by default the kind is "primitive" with no extra options