Package net.luckperms.api.metastacking
Interface MetaStackFactory
public interface MetaStackFactory
Factory to create meta stack elements and definitions.
-
Method Summary
Modifier and TypeMethodDescriptioncreateDefinition(@NonNull List<MetaStackElement> elements, @NonNull DuplicateRemovalFunction duplicateRemovalFunction, @NonNull String startSpacer, @NonNull String middleSpacer, @NonNull String endSpacer) Creates a newMetaStackDefinitionwith the given properties.fromString(@NonNull String definition) Parses a standardMetaStackElementfrom string, using the pre-defined elements in the plugin.fromStrings(@NonNull List<String> definitions) Parses a list ofMetaStackElements from string, using the pre-defined elements in the plugin.
-
Method Details
-
fromString
Parses a standardMetaStackElementfrom string, using the pre-defined elements in the plugin.- Parameters:
definition- the definition- Returns:
- the parsed element, if present
-
fromStrings
Parses a list ofMetaStackElements from string, using the pre-defined elements in the plugin.If an element cannot be parsed, it will not be included in the resultant list.
- Parameters:
definitions- the definition strings- Returns:
- a list of parsed elements
-
createDefinition
@NonNull MetaStackDefinition createDefinition(@NonNull List<MetaStackElement> elements, @NonNull DuplicateRemovalFunction duplicateRemovalFunction, @NonNull String startSpacer, @NonNull String middleSpacer, @NonNull String endSpacer) Creates a newMetaStackDefinitionwith the given properties.- Parameters:
elements- the elements to be included in the stack.duplicateRemovalFunction- the duplicate removal functionstartSpacer- the spacer to be included at the start of the stacks outputmiddleSpacer- the spacer to be included between stack elementsendSpacer- the spacer to be included at the end of the stacks output- Returns:
- the new stack definition instance
-