Package net.luckperms.api.metastacking
Interface MetaStackFactory
-
public interface MetaStackFactoryFactory to create meta stack elements and definitions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NonNull MetaStackDefinitioncreateDefinition(@NonNull List<MetaStackElement> elements, @NonNull DuplicateRemovalFunction duplicateRemovalFunction, @NonNull String startSpacer, @NonNull String middleSpacer, @NonNull String endSpacer)Creates a newMetaStackDefinitionwith the given properties.@NonNull Optional<MetaStackElement>fromString(@NonNull String definition)Parses a standardMetaStackElementfrom string, using the pre-defined elements in the plugin.@NonNull @Unmodifiable List<MetaStackElement>fromStrings(@NonNull List<String> definitions)Parses a list ofMetaStackElements from string, using the pre-defined elements in the plugin.
-
-
-
Method Detail
-
fromString
@NonNull Optional<MetaStackElement> fromString(@NonNull String definition)
Parses a standardMetaStackElementfrom string, using the pre-defined elements in the plugin.- Parameters:
definition- the definition- Returns:
- the parsed element, if present
-
fromStrings
@NonNull @Unmodifiable List<MetaStackElement> fromStrings(@NonNull List<String> definitions)
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
-
-