public class EnhancedComponentBuilder
extends java.lang.Object
TextColor (or Color)
- Component
- ComponentBuilder
- TextFormat
- Style
- Any other Objects will be converted to strings| Modifier | Constructor and Description |
|---|---|
protected |
EnhancedComponentBuilder(EnhancedLegacyText enhancedLegacyText,
java.lang.String input) |
| Modifier and Type | Method and Description |
|---|---|
net.kyori.adventure.text.Component |
build()
Creates a
Component from the provided input and replacements. |
@NotNull java.lang.String |
getInput()
Getter for the input text.
|
RecursiveReplacement |
getRecursiveReplacement()
Gets the recursive replacement policy.
|
@NotNull java.util.List<Pair<java.util.regex.Pattern,java.util.function.Function<java.util.regex.Matcher,java.lang.Object>>> |
getReplacements()
Getter for the replacements.
|
@NotNull EnhancedComponentBuilder |
replace(@NotNull java.lang.String target,
@NotNull java.util.function.Function<java.util.regex.Matcher,java.lang.Object> replacement)
Adds a replacement to the component.
|
EnhancedComponentBuilder |
replace(java.lang.String target,
java.lang.Object replacement)
Adds a replacement to the component.
|
EnhancedComponentBuilder |
replace(java.lang.String target,
java.util.function.Supplier<java.lang.Object> replacement)
Adds a replacement to the component.
|
@NotNull EnhancedComponentBuilder |
replaceAll(@NotNull java.util.regex.Pattern regex,
@NotNull java.util.function.Function<java.util.regex.Matcher,java.lang.Object> replacement)
Adds a replacement to the component.
|
EnhancedComponentBuilder |
replaceAll(java.util.regex.Pattern regex,
java.lang.Object replacement)
Adds a replacement to the component.
|
EnhancedComponentBuilder |
replaceAll(java.util.regex.Pattern regex,
java.util.function.Supplier<java.lang.Object> replacement)
Adds a replacement to the component.
|
@NotNull EnhancedComponentBuilder |
replaceAll(@NotNull java.lang.String regex,
@NotNull java.util.function.Function<java.util.regex.Matcher,java.lang.Object> replacement)
Adds a replacement to the component.
|
EnhancedComponentBuilder |
replaceAll(java.lang.String regex,
java.lang.Object replacement)
Adds a replacement to the component.
|
EnhancedComponentBuilder |
replaceAll(java.lang.String regex,
java.util.function.Supplier<java.lang.Object> replacement)
Adds a replacement to the component.
|
EnhancedComponentBuilder |
setRecursiveReplacement(@NotNull RecursiveReplacement replacement)
Sets the recursive replacement policy.
|
protected EnhancedComponentBuilder(EnhancedLegacyText enhancedLegacyText, java.lang.String input)
public EnhancedComponentBuilder replace(java.lang.String target, java.lang.Object replacement)
target - the literal text to replacereplacement - the replacement (see EnhancedComponentBuilder for possible replacements)public EnhancedComponentBuilder replaceAll(java.lang.String regex, java.lang.Object replacement)
regex - the regex pattern for the replacementreplacement - the replacement (see EnhancedComponentBuilder for possible replacements)public EnhancedComponentBuilder replaceAll(java.util.regex.Pattern regex, java.lang.Object replacement)
regex - the regex pattern for the replacementreplacement - the replacement (see EnhancedComponentBuilder for possible replacements)public EnhancedComponentBuilder replace(java.lang.String target, java.util.function.Supplier<java.lang.Object> replacement)
target - the literal text to replacereplacement - the replacement (see EnhancedComponentBuilder for possible replacements)public EnhancedComponentBuilder replaceAll(java.lang.String regex, java.util.function.Supplier<java.lang.Object> replacement)
regex - the regex pattern for the replacementreplacement - the replacement (see EnhancedComponentBuilder for possible replacements)public EnhancedComponentBuilder replaceAll(java.util.regex.Pattern regex, java.util.function.Supplier<java.lang.Object> replacement)
regex - the regex pattern for the replacementreplacement - the replacement (see EnhancedComponentBuilder for possible replacements)@NotNull public @NotNull EnhancedComponentBuilder replace(@NotNull @NotNull java.lang.String target, @NotNull @NotNull java.util.function.Function<java.util.regex.Matcher,java.lang.Object> replacement)
target - the literal text to replacereplacement - the replacement (see EnhancedComponentBuilder for possible replacements)@NotNull public @NotNull EnhancedComponentBuilder replaceAll(@NotNull @NotNull java.lang.String regex, @NotNull @NotNull java.util.function.Function<java.util.regex.Matcher,java.lang.Object> replacement)
regex - the regex pattern for the replacementreplacement - the replacement (see EnhancedComponentBuilder for possible replacements)@NotNull public @NotNull EnhancedComponentBuilder replaceAll(@NotNull @NotNull java.util.regex.Pattern regex, @NotNull @NotNull java.util.function.Function<java.util.regex.Matcher,java.lang.Object> replacement)
regex - the regex pattern for the replacementreplacement - the replacement (see EnhancedComponentBuilder for possible replacements)@NotNull public @NotNull java.lang.String getInput()
@NotNull public @NotNull java.util.List<Pair<java.util.regex.Pattern,java.util.function.Function<java.util.regex.Matcher,java.lang.Object>>> getReplacements()
public EnhancedComponentBuilder setRecursiveReplacement(@NotNull @NotNull RecursiveReplacement replacement)
RecursiveReplacement.ONLY_FOLLOWING.replacement - the recursive replacement policypublic RecursiveReplacement getRecursiveReplacement()
public net.kyori.adventure.text.Component build()
Component from the provided input and replacements.Component