Class LocalizedTextTypeAdapter

java.lang.Object
com.google.gson.TypeAdapter<app.l2nx.gs.adapter.api.localization.LocalizedText>
app.l2nx.gs.adapter.core.kafka.LocalizedTextTypeAdapter

public final class LocalizedTextTypeAdapter extends com.google.gson.TypeAdapter<app.l2nx.gs.adapter.api.localization.LocalizedText>
Gson TypeAdapter for LocalizedText: reads / writes the flat locale-keyed object form ({"en": "Great Axe", "ru": "Двуручный Топор"}) matching the platform's LocalizedText wire shape.

Lives in adapter-core (not nx-gs-kafka) because the Gson factory in nx-gs-kafka must stay free of any nx-gs-adapter-api dependency; adapter-core depends on api and registers this adapter onto the producer Gson at construction time.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    app.l2nx.gs.adapter.api.localization.LocalizedText
    read(com.google.gson.stream.JsonReader in)
     
    void
    write(com.google.gson.stream.JsonWriter out, app.l2nx.gs.adapter.api.localization.LocalizedText value)
     

    Methods inherited from class com.google.gson.TypeAdapter

    fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LocalizedTextTypeAdapter

      public LocalizedTextTypeAdapter()
  • Method Details

    • write

      public void write(com.google.gson.stream.JsonWriter out, app.l2nx.gs.adapter.api.localization.LocalizedText value) throws IOException
      Specified by:
      write in class com.google.gson.TypeAdapter<app.l2nx.gs.adapter.api.localization.LocalizedText>
      Throws:
      IOException
    • read

      public app.l2nx.gs.adapter.api.localization.LocalizedText read(com.google.gson.stream.JsonReader in) throws IOException
      Specified by:
      read in class com.google.gson.TypeAdapter<app.l2nx.gs.adapter.api.localization.LocalizedText>
      Throws:
      IOException