Class PlainComponentSerializer
java.lang.Object
net.kyori.adventure.text.serializer.plain.PlainComponentSerializer
- All Implemented Interfaces:
net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
,net.kyori.adventure.util.Buildable<PlainComponentSerializer,PlainComponentSerializer.Builder>
public class PlainComponentSerializer extends Object implements net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>, net.kyori.adventure.util.Buildable<PlainComponentSerializer,PlainComponentSerializer.Builder>
A plain component serializer.
Plain does not support more complex features such as, but not limited
to, colours, decorations, ClickEvent
, and HoverEvent
.
- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PlainComponentSerializer.Builder
A builder for the plain component serializer. -
Constructor Summary
Constructors Constructor Description PlainComponentSerializer()
Deprecated.for removal since 4.7.0PlainComponentSerializer(@Nullable Function<net.kyori.adventure.text.KeybindComponent,String> keybind, @Nullable Function<net.kyori.adventure.text.TranslatableComponent,String> translatable)
Deprecated.for removal since 4.7.0, use the builder instead -
Method Summary
Modifier and Type Method Description static @NonNull PlainComponentSerializer.Builder
builder()
Create a new builder.@NonNull net.kyori.adventure.text.TextComponent
deserialize(@NonNull String input)
static @NonNull PlainComponentSerializer
plain()
A component serializer for plain-based serialization and deserialization.void
serialize(@NonNull StringBuilder sb, @NonNull net.kyori.adventure.text.Component component)
Serializes.@NonNull String
serialize(@NonNull net.kyori.adventure.text.Component component)
@NonNull PlainComponentSerializer.Builder
toBuilder()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.kyori.adventure.text.serializer.ComponentSerializer
deseializeOrNull, deserializeOr, serializeOr, serializeOrNull
-
Constructor Details
-
PlainComponentSerializer
Deprecated.for removal since 4.7.0Constructs.- Since:
- 4.0.0
-
PlainComponentSerializer
@Deprecated public PlainComponentSerializer(@Nullable Function<net.kyori.adventure.text.KeybindComponent,String> keybind, @Nullable Function<net.kyori.adventure.text.TranslatableComponent,String> translatable)Deprecated.for removal since 4.7.0, use the builder insteadConstructs.- Parameters:
keybind
- the keybind renderertranslatable
- the translatable renderer- Since:
- 4.0.0
-
-
Method Details
-
plain
A component serializer for plain-based serialization and deserialization.- Returns:
- serializer instance
- Since:
- 4.0.0
-
builder
Create a new builder.- Returns:
- a new plain serializer builder
- Since:
- 4.7.0
-
deserialize
- Specified by:
deserialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
-
serialize
- Specified by:
serialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
-
serialize
public void serialize(@NonNull StringBuilder sb, @NonNull net.kyori.adventure.text.Component component)Serializes.- Parameters:
sb
- the string buildercomponent
- the component- Since:
- 4.0.0
-
toBuilder
- Specified by:
toBuilder
in interfacenet.kyori.adventure.util.Buildable<PlainComponentSerializer,PlainComponentSerializer.Builder>
-