Package com.djrapitops.plan.placeholder
Class PlanPlaceholders
- java.lang.Object
-
- com.djrapitops.plan.placeholder.PlanPlaceholders
-
@Singleton public final class PlanPlaceholders extends java.lang.Object
Registry for all placeholders.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PlanPlaceholders.PlayerPlaceholderLoader
static interface
PlanPlaceholders.StaticPlaceholderLoader
-
Constructor Summary
Constructors Constructor Description PlanPlaceholders(DBSystem dbSystem, java.util.Set<Placeholders> placeholderRegistries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,PlanPlaceholders.PlayerPlaceholderLoader>
getPlaceholders()
java.util.Map<java.lang.String,PlanPlaceholders.StaticPlaceholderLoader>
getStaticPlaceholders()
java.lang.String
onPlaceholderRequest(PlayerContainer player, java.lang.String placeholder, java.util.List<java.lang.String> parameters)
Look up the placeholder and check if it is registered.java.lang.String
onPlaceholderRequest(java.util.UUID uuid, java.lang.String placeholder, java.util.List<java.lang.String> parameters)
void
register(java.lang.String name, PlanPlaceholders.PlayerPlaceholderLoader loader)
void
register(java.lang.String name, java.util.function.Function<PlayerContainer,java.io.Serializable> loader)
void
registerRaw(java.lang.String name, java.util.function.BiFunction<java.lang.String,PlayerContainer,java.io.Serializable> loader)
void
registerStatic(java.lang.String name, PlanPlaceholders.StaticPlaceholderLoader loader)
void
registerStatic(java.lang.String name, java.util.function.Supplier<java.io.Serializable> loader)
-
-
-
Constructor Detail
-
PlanPlaceholders
@Inject public PlanPlaceholders(DBSystem dbSystem, java.util.Set<Placeholders> placeholderRegistries)
-
-
Method Detail
-
registerStatic
public void registerStatic(java.lang.String name, java.util.function.Supplier<java.io.Serializable> loader)
-
registerStatic
public void registerStatic(java.lang.String name, PlanPlaceholders.StaticPlaceholderLoader loader)
-
register
public void register(java.lang.String name, java.util.function.Function<PlayerContainer,java.io.Serializable> loader)
-
register
public void register(java.lang.String name, PlanPlaceholders.PlayerPlaceholderLoader loader)
-
registerRaw
public void registerRaw(java.lang.String name, java.util.function.BiFunction<java.lang.String,PlayerContainer,java.io.Serializable> loader)
-
getPlaceholders
public java.util.Map<java.lang.String,PlanPlaceholders.PlayerPlaceholderLoader> getPlaceholders()
-
getStaticPlaceholders
public java.util.Map<java.lang.String,PlanPlaceholders.StaticPlaceholderLoader> getStaticPlaceholders()
-
onPlaceholderRequest
public java.lang.String onPlaceholderRequest(java.util.UUID uuid, java.lang.String placeholder, java.util.List<java.lang.String> parameters)
-
onPlaceholderRequest
public java.lang.String onPlaceholderRequest(PlayerContainer player, java.lang.String placeholder, java.util.List<java.lang.String> parameters)
Look up the placeholder and check if it is registered.- Parameters:
player
- the player who is viewing the placeholderplaceholder
- the placeholder to look up to.parameters
- additional placeholder parameters- Returns:
- the value of the placeholder if found, or empty
String
if no value found but the placeholder is registered, otherwisenull
-
-