Package net.luckperms.api.metastacking
Interface MetaStackDefinition
public interface MetaStackDefinition
Represents a meta stack model, consisting of a chain of elements, separated by spacers.
The resultant string is constructed as: [start spacer] [element] [middle spacer] [element] [middle spacer] [element] [end spacer]
Definitions can be passed to a users UserData instance using MetaContexts, and the result of this stack can be retrieved from the returned MetaData instance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OptionKey<MetaStackDefinition>TheOptionKeyfor the prefixMetaStackDefinition.static final OptionKey<MetaStackDefinition>TheOptionKeyfor the suffixMetaStackDefinition. -
Method Summary
Modifier and TypeMethodDescriptionGets the duplicate removal function, applied to the entries before formatting takes place.Gets an immutable list of the elements in this stack definitionGets the spacer added after any stack elementsGets the spacer added between stack elementsGets the spacer string added before any stack elements
-
Field Details
-
PREFIX_STACK_KEY
TheOptionKeyfor the prefixMetaStackDefinition. -
SUFFIX_STACK_KEY
TheOptionKeyfor the suffixMetaStackDefinition.
-
-
Method Details
-
getElements
@NonNull @Unmodifiable List<MetaStackElement> getElements()Gets an immutable list of the elements in this stack definition- Returns:
- the elements in this stack
-
getDuplicateRemovalFunction
@NonNull DuplicateRemovalFunction getDuplicateRemovalFunction()Gets the duplicate removal function, applied to the entries before formatting takes place.- Returns:
- the duplicate removal function
-
getStartSpacer
Gets the spacer string added before any stack elements- Returns:
- the start spacer
-
getMiddleSpacer
Gets the spacer added between stack elements- Returns:
- the middle spacer
-
getEndSpacer
Gets the spacer added after any stack elements- Returns:
- the end spacer
-