Class AbstractRegistryList.Builder<T extends org.bukkit.Keyed,F extends AbstractRegistryList<T>>
java.lang.Object
com.palmergames.bukkit.towny.object.AbstractRegistryList.Builder<T,F>
- Enclosing class:
AbstractRegistryList<T extends org.bukkit.Keyed>
public static class AbstractRegistryList.Builder<T extends org.bukkit.Keyed,F extends AbstractRegistryList<T>>
extends Object
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionManually adds the given names to the resulting list, assuming that they can be matched and are available on the current running version.build()
conditionally
(@NotNull BooleanSupplier supplier, @NotNull Consumer<AbstractRegistryList.Builder<T, F>> consumer) excludeTag
(@NotNull String registry, @NotNull org.bukkit.NamespacedKey key) Identical towithTag(String, NamespacedKey)
, but reverse.includeList
(@NotNull AbstractRegistryList<T> list) Adds an entire lists contents.notContains
(@NotNull String notContaining) notEndsWith
(@NotNull String notEndingWith) notStartsWith
(@NotNull String notStartingWith) startsWith
(String startingWith) Matches all elements in a specific vanilla tag to be added to the resulting list.
-
Constructor Details
-
Builder
- Parameters:
registry
- The bukkit registry, used for matching strings intoAbstractRegistryList.Builder
.clazz
- The class that belongs toAbstractRegistryList.Builder
, used for tag lookups inwithTag(String, NamespacedKey)
.function
- The mapping function to convert aCollection<T>
to your implementing class, this can just beMyClass::new
.
-
-
Method Details
-
build
-
startsWith
-
endsWith
-
not
-
notStartsWith
-
notEndsWith
-
contains
-
notContains
-
withTag
public AbstractRegistryList.Builder<T,F> withTag(@NotNull @NotNull String registry, @NotNull @NotNull org.bukkit.NamespacedKey key) Matches all elements in a specific vanilla tag to be added to the resulting list.
Tags can be found here.- Parameters:
registry
- The registry to look in, i.e. 'blocks' or 'items'. SeeTag
for registry name constants.key
- The key of the tag.
-
excludeTag
public AbstractRegistryList.Builder<T,F> excludeTag(@NotNull @NotNull String registry, @NotNull @NotNull org.bukkit.NamespacedKey key) Identical towithTag(String, NamespacedKey)
, but reverse.- Parameters:
registry
- The registry to look in, i.e. 'blocks' or 'items'. SeeTag
for registry name constants.key
- The key of the tag.
-
add
Manually adds the given names to the resulting list, assuming that they can be matched and are available on the current running version.- Parameters:
names
- An array of names to add.
-
includeList
public AbstractRegistryList.Builder<T,F> includeList(@NotNull @NotNull AbstractRegistryList<T> list) Adds an entire lists contents.- Parameters:
list
- list to add.
-
filter
-
conditionally
public AbstractRegistryList.Builder<T,F> conditionally(@NotNull @NotNull BooleanSupplier supplier, @NotNull @NotNull Consumer<AbstractRegistryList.Builder<T, F>> consumer)
-