Interface HudPlaceholder<T>
- Type Parameters:
T- type (Number, String, Boolean)
public interface HudPlaceholder<T>
Represents placeholder
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classPlaceholder builderstatic interfaceAn aliases of (args, event) -> (player) -> T -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> HudPlaceholder.Builder<T> builder()Creates placeholder builder.intGets a length of required args.invoke(@NotNull @Unmodifiable List<String> args, @NotNull UpdateEvent reason) Creates new function from given args.static <T> @NotNull HudPlaceholder<T> of(@NotNull HudPlaceholder.PlaceholderFunction<T> biFunction) Creates new placeholder by function.
-
Method Details
-
invoke
@NotNull @NotNull Function<HudPlayer, T> invoke(@NotNull @NotNull @Unmodifiable List<String> args, @NotNull @NotNull UpdateEvent reason) Creates new function from given args.- Parameters:
args- argsreason- event- Returns:
- function
- Throws:
RuntimeException- if given args or reason is invalid.
-
getRequiredArgsLength
int getRequiredArgsLength()Gets a length of required args.- Returns:
- args length.
-
of
@NotNull static <T> @NotNull HudPlaceholder<T> of(@NotNull @NotNull HudPlaceholder.PlaceholderFunction<T> biFunction) Creates new placeholder by function.- Type Parameters:
T- return value's type.- Parameters:
biFunction- builder- Returns:
- an instance of placeholder.
-
builder
Creates placeholder builder.- Type Parameters:
T- type (Number, String, Boolean)- Returns:
- builder
-