Class GsonComponentSerializerWrapper

java.lang.Object
org.geysermc.connector.network.translators.chat.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 final class GsonComponentSerializerWrapper extends Object 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)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.kyori.adventure.text.Component
    deserialize​(@NotNull String input)
     
    @NotNull net.kyori.adventure.text.Component
    deserializeFromTree​(@NotNull com.google.gson.JsonElement input)
     
    @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)
     
    @NotNull net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder
     

    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, deserializeOrNull, serializeOr, serializeOrNull
  • Constructor Details

    • GsonComponentSerializerWrapper

      public GsonComponentSerializerWrapper(net.kyori.adventure.text.serializer.gson.GsonComponentSerializer source)
  • Method Details

    • serializer

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

      @NotNull public @NotNull UnaryOperator<com.google.gson.GsonBuilder> populator()
      Specified by:
      populator in interface net.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 interface net.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 interface net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
    • deserialize

      @Nullable public @Nullable net.kyori.adventure.text.Component deserialize(@NotNull @NotNull 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

      @NotNull public @NotNull String serialize(@NotNull @NotNull net.kyori.adventure.text.Component component)
      Specified by:
      serialize in interface net.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 interface net.kyori.adventure.util.Buildable<net.kyori.adventure.text.serializer.gson.GsonComponentSerializer,​net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.Builder>