Record Class GsonComponentSerializerWrapper

java.lang.Object
java.lang.Record
org.geysermc.geyser.text.GsonComponentSerializerWrapper
All Implemented Interfaces:
net.kyori.adventure.text.serializer.ComponentEncoder<net.kyori.adventure.text.Component,String>, 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.text.serializer.json.JSONComponentSerializer, 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

    Constructors
    Constructor
    Description
    GsonComponentSerializerWrapper(net.kyori.adventure.text.serializer.gson.GsonComponentSerializer source)
    Creates an instance of a GsonComponentSerializerWrapper record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull net.kyori.adventure.text.Component
    deserialize(@NonNull String input)
     
    @NonNull net.kyori.adventure.text.Component
    deserializeFromTree(@NonNull com.google.gson.JsonElement input)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NonNull UnaryOperator<com.google.gson.GsonBuilder>
     
    @NonNull String
    serialize(@NonNull net.kyori.adventure.text.Component component)
     
    @NonNull com.google.gson.Gson
     
    @NonNull com.google.gson.JsonElement
    serializeToTree(@NonNull net.kyori.adventure.text.Component component)
     
    net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
    Returns the value of the source record component.
    @NonNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder
     
    final String
    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 a GsonComponentSerializerWrapper record class.
      Parameters:
      source - the value for the source record component
  • Method Details

    • serializer

      public @NonNull com.google.gson.Gson serializer()
      Specified by:
      serializer in interface net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
    • populator

      public @NonNull UnaryOperator<com.google.gson.GsonBuilder> populator()
      Specified by:
      populator in interface net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
    • deserializeFromTree

      public @NonNull net.kyori.adventure.text.Component deserializeFromTree(@NonNull com.google.gson.JsonElement input)
      Specified by:
      deserializeFromTree in interface net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
    • serializeToTree

      public @NonNull com.google.gson.JsonElement serializeToTree(@NonNull net.kyori.adventure.text.Component component)
      Specified by:
      serializeToTree in interface net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
    • deserialize

      public @NonNull net.kyori.adventure.text.Component deserialize(@NonNull String input)
      Specified by:
      deserialize in interface net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component,String>
    • serialize

      public @NonNull String serialize(@NonNull net.kyori.adventure.text.Component component)
      Specified by:
      serialize in interface net.kyori.adventure.text.serializer.ComponentEncoder<net.kyori.adventure.text.Component,String>
      Specified by:
      serialize in interface net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.Component,String>
    • toBuilder

      public @NonNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder toBuilder()
      Specified by:
      toBuilder in interface net.kyori.adventure.util.Buildable<net.kyori.adventure.text.serializer.gson.GsonComponentSerializer,net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • source

      public net.kyori.adventure.text.serializer.gson.GsonComponentSerializer source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component