RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.util.GsonUtils Enum Reference

Static Public Member Functions

static Gson json ()
static Gson jsonAllowNull ()
static Gson jsonPrettyAllowNull ()
static Gson jsonPrettyNoNulls ()

Static Public Attributes

static final ThreadLocal< Gson > JSON_ALLOW_NULL
static final ThreadLocal< Gson > JSON_PRETTY_ALLOW_NULL
static final ThreadLocal< Gson > JSON_PRETTY_NO_NULLS

Detailed Description

Definition at line 8 of file GsonUtils.java.

Member Function Documentation

◆ json()

Gson com.runehive.util.GsonUtils.json ( )
static

Definition at line 36 of file GsonUtils.java.

36 {
37 return jsonPrettyAllowNull();
38 }

References jsonPrettyAllowNull().

Referenced by com.runehive.game.world.entity.mob.player.profile.ProfileRepository.load(), and com.runehive.game.world.entity.mob.player.profile.ProfileRepository.save().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jsonAllowNull()

Gson com.runehive.util.GsonUtils.jsonAllowNull ( )
static

Definition at line 24 of file GsonUtils.java.

24 {
25 return JSON_ALLOW_NULL.get();
26 }

References JSON_ALLOW_NULL.

◆ jsonPrettyAllowNull()

Gson com.runehive.util.GsonUtils.jsonPrettyAllowNull ( )
static

Definition at line 28 of file GsonUtils.java.

28 {
29 return JSON_PRETTY_ALLOW_NULL.get();
30 }

References JSON_PRETTY_ALLOW_NULL.

Referenced by json().

Here is the caller graph for this function:

◆ jsonPrettyNoNulls()

Gson com.runehive.util.GsonUtils.jsonPrettyNoNulls ( )
static

Definition at line 32 of file GsonUtils.java.

32 {
33 return JSON_PRETTY_NO_NULLS.get();
34 }

References JSON_PRETTY_NO_NULLS.

Member Data Documentation

◆ JSON_ALLOW_NULL

final ThreadLocal<Gson> com.runehive.util.GsonUtils.JSON_ALLOW_NULL
static
Initial value:
= ThreadLocal.withInitial(() ->
new GsonBuilder().disableHtmlEscaping().serializeNulls().create())

Definition at line 13 of file GsonUtils.java.

Referenced by com.runehive.content.tradingpost.TradingPost.getCoffer(), jsonAllowNull(), and com.runehive.content.tradingpost.TradingPost.loadAllListings().

◆ JSON_PRETTY_ALLOW_NULL

final ThreadLocal<Gson> com.runehive.util.GsonUtils.JSON_PRETTY_ALLOW_NULL
static
Initial value:
= ThreadLocal.withInitial(() ->
new GsonBuilder()
.registerTypeAdapter(OptionalInt.class, new OptionalIntAdapter())
.setPrettyPrinting()
.disableHtmlEscaping()
.serializeNulls()
.create())

Definition at line 20 of file GsonUtils.java.

Referenced by jsonPrettyAllowNull(), com.runehive.util.GameSaver.load(), com.runehive.content.tradingpost.TradingPost.saveCoffer(), com.runehive.content.tradingpost.TradingPost.saveListings(), com.runehive.content.store.PersonalStoreSaver.savePayments(), and com.runehive.util.GameSaver.toJson().

◆ JSON_PRETTY_NO_NULLS

final ThreadLocal<Gson> com.runehive.util.GsonUtils.JSON_PRETTY_NO_NULLS
static
Initial value:
= ThreadLocal.withInitial(() ->
new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create())

Definition at line 22 of file GsonUtils.java.

Referenced by jsonPrettyNoNulls(), com.runehive.util.GameSaver.save(), com.runehive.content.clanchannel.ClanRepository.saveClan(), and com.runehive.game.task.impl.ClanUpdateEvent.tick().


The documentation for this enum was generated from the following file: