Class HologramProviderPicker<I,T>
java.lang.Object
io.github.projectunified.unihologram.picker.HologramProviderPicker<I,T>
- Type Parameters:
I- The type of the inputT- The type of the location of the hologram
- Direct Known Subclasses:
SpigotHologramProviderPicker
A picker for
HologramProvider.
This preserves the order of the entries based on the order of the calls to the add method.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(BooleanSupplier condition, Function<I, HologramProvider<T>> provider) Add an entryadd(BooleanSupplier condition, Supplier<HologramProvider<T>> provider) Add an entryAdd an entryAdd an entryprotected HologramProvider<T>getDefaultProvider(I input) Get the default provider.pick()Pick the provider
-
Constructor Details
-
HologramProviderPicker
Create a new picker- Parameters:
input- the input
-
-
Method Details
-
add
public HologramProviderPicker<I,T> add(Predicate<I> condition, Function<I, HologramProvider<T>> provider) Add an entry- Parameters:
condition- the conditionprovider- the provider- Returns:
- this
-
add
public HologramProviderPicker<I,T> add(BooleanSupplier condition, Function<I, HologramProvider<T>> provider) Add an entry- Parameters:
condition- the conditionprovider- the provider- Returns:
- this
-
add
public HologramProviderPicker<I,T> add(Predicate<I> condition, Supplier<HologramProvider<T>> provider) Add an entry- Parameters:
condition- the conditionprovider- the provider- Returns:
- this
-
add
public HologramProviderPicker<I,T> add(BooleanSupplier condition, Supplier<HologramProvider<T>> provider) Add an entry- Parameters:
condition- the conditionprovider- the provider- Returns:
- this
-
pick
Pick the provider- Returns:
- the provider
-
getDefaultProvider
Get the default provider. By default, this throws an exception.- Parameters:
input- the input- Returns:
- the default provider
-