Package kr.toxicity.model.api.util.json
Class JsonObjectBuilder
java.lang.Object
kr.toxicity.model.api.util.json.JsonObjectBuilder
JSON object builder
-
Method Summary
Modifier and TypeMethodDescription@NotNull com.google.gson.JsonObjectbuild()Builds JSON objectstatic @NotNull JsonObjectBuilderbuilder()Creates builder@NotNull JsonObjectBuilderAdds JSON array@NotNull JsonObjectBuilderjsonObject(@NotNull String name, @Nullable com.google.gson.JsonObject jsonObject) Adds JSON object@NotNull JsonObjectBuilderjsonObject(@NotNull String name, @NotNull Consumer<JsonObjectBuilder> consumer) Adds JSON object@NotNull JsonObjectBuilderAdds JSON property@NotNull JsonObjectBuilderAdds JSON property@NotNull JsonObjectBuilderAdds JSON property
-
Method Details
-
builder
Creates builder- Returns:
- builder
-
build
@NotNull public @NotNull com.google.gson.JsonObject build()Builds JSON object- Returns:
- build
-
jsonObject
@NotNull public @NotNull JsonObjectBuilder jsonObject(@NotNull @NotNull String name, @NotNull @NotNull Consumer<JsonObjectBuilder> consumer) Adds JSON object- Parameters:
name- nameconsumer- builder- Returns:
- self
-
jsonObject
@NotNull public @NotNull JsonObjectBuilder jsonObject(@NotNull @NotNull String name, @Nullable @Nullable com.google.gson.JsonObject jsonObject) Adds JSON object- Parameters:
name- namejsonObject- object- Returns:
- self
-
jsonArray
@NotNull public @NotNull JsonObjectBuilder jsonArray(@NotNull @NotNull String name, @Nullable @Nullable com.google.gson.JsonArray array) Adds JSON array- Parameters:
name- namearray- array- Returns:
- self
-
property
@NotNull public @NotNull JsonObjectBuilder property(@NotNull @NotNull String name, @NotNull @NotNull String property) Adds JSON property- Parameters:
name- nameproperty- property- Returns:
- self
-
property
@NotNull public @NotNull JsonObjectBuilder property(@NotNull @NotNull String name, @NotNull @NotNull Boolean property) Adds JSON property- Parameters:
name- nameproperty- property- Returns:
- self
-
property
@NotNull public @NotNull JsonObjectBuilder property(@NotNull @NotNull String name, @NotNull @NotNull Number property) Adds JSON property- Parameters:
name- nameproperty- property- Returns:
- self
-