Class JsonObjectBuilder

java.lang.Object
kr.toxicity.model.api.util.json.JsonObjectBuilder

@Internal public final class JsonObjectBuilder extends Object
JSON object builder
  • Method Details

    • builder

      @NotNull public static @NotNull JsonObjectBuilder 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 - name
      consumer - 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 - name
      jsonObject - 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 - name
      array - array
      Returns:
      self
    • property

      @NotNull public @NotNull JsonObjectBuilder property(@NotNull @NotNull String name, @NotNull @NotNull String property)
      Adds JSON property
      Parameters:
      name - name
      property - property
      Returns:
      self
    • property

      @NotNull public @NotNull JsonObjectBuilder property(@NotNull @NotNull String name, @NotNull @NotNull Boolean property)
      Adds JSON property
      Parameters:
      name - name
      property - property
      Returns:
      self
    • property

      @NotNull public @NotNull JsonObjectBuilder property(@NotNull @NotNull String name, @NotNull @NotNull Number property)
      Adds JSON property
      Parameters:
      name - name
      property - property
      Returns:
      self