Package app.l2nx.gs.adapter.core.kafka
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 -
Method Summary
Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
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:
writein classcom.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:
readin classcom.google.gson.TypeAdapter<app.l2nx.gs.adapter.api.localization.LocalizedText>- Throws:
IOException
-