Package org.geysermc.geyser.text
Record Class GsonComponentSerializerWrapper
java.lang.Object
java.lang.Record
org.geysermc.geyser.text.GsonComponentSerializerWrapper
- All Implemented Interfaces:
net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component,String>
,net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
,net.kyori.adventure.util.Buildable<net.kyori.adventure.text.serializer.gson.GsonComponentSerializer,net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder>
public record GsonComponentSerializerWrapper(net.kyori.adventure.text.serializer.gson.GsonComponentSerializer source)
extends Record
implements net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
A wrapper around a normal GsonComponentSerializer to accept null components.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder, net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Provider
-
Constructor Summary
ConstructorDescriptionGsonComponentSerializerWrapper(net.kyori.adventure.text.serializer.gson.GsonComponentSerializer source)
Creates an instance of aGsonComponentSerializerWrapper
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.kyori.adventure.text.Component
deserialize(@NotNull String input)
@NotNull net.kyori.adventure.text.Component
deserializeFromTree(@NotNull com.google.gson.JsonElement input)
boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.@NotNull UnaryOperator<com.google.gson.GsonBuilder>
@NotNull String
serialize(@NotNull net.kyori.adventure.text.Component component)
@NotNull com.google.gson.Gson
@NotNull com.google.gson.JsonElement
serializeToTree(@NotNull net.kyori.adventure.text.Component component)
net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
source()
Returns the value of thesource
record component.@NotNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.kyori.adventure.text.serializer.ComponentSerializer
deseializeOrNull, deserializeOr, deserializeOrNull, serializeOr, serializeOrNull
-
Constructor Details
-
GsonComponentSerializerWrapper
public GsonComponentSerializerWrapper(net.kyori.adventure.text.serializer.gson.GsonComponentSerializer source)Creates an instance of aGsonComponentSerializerWrapper
record class.- Parameters:
source
- the value for thesource
record component
-
-
Method Details
-
serializer
@NotNull public @NotNull com.google.gson.Gson serializer()- Specified by:
serializer
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
populator
- Specified by:
populator
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
deserializeFromTree
@NotNull public @NotNull net.kyori.adventure.text.Component deserializeFromTree(@NotNull @NotNull com.google.gson.JsonElement input)- Specified by:
deserializeFromTree
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
serializeToTree
@NotNull public @NotNull com.google.gson.JsonElement serializeToTree(@NotNull @NotNull net.kyori.adventure.text.Component component)- Specified by:
serializeToTree
in interfacenet.kyori.adventure.text.serializer.gson.GsonComponentSerializer
-
deserialize
@Nullable public @Nullable net.kyori.adventure.text.Component deserialize(@NotNull @NotNull String input)- Specified by:
deserialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component,String>
-
serialize
@NotNull public @NotNull String serialize(@NotNull @NotNull net.kyori.adventure.text.Component component)- Specified by:
serialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component,String>
-
toBuilder
@NotNull public @NotNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder toBuilder()- Specified by:
toBuilder
in interfacenet.kyori.adventure.util.Buildable<net.kyori.adventure.text.serializer.gson.GsonComponentSerializer,net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
source
public net.kyori.adventure.text.serializer.gson.GsonComponentSerializer source()Returns the value of thesource
record component.- Returns:
- the value of the
source
record component
-