Package javax.json
Interface JsonObjectBuilder
-
public interface JsonObjectBuilderA JsonObjectBuilder can be used to buildJsonObjects. Instances are not thread safe. Calling any of those methods with either thenameorvalueparam asnullwill result in aNullPointerException
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description JsonObjectBuilderadd(java.lang.String name, boolean value)Add the given boolean value to the JsonObject to be created.JsonObjectBuilderadd(java.lang.String name, double value)Add the given double value to the JsonObject to be created.JsonObjectBuilderadd(java.lang.String name, int value)Add the given int value to the JsonObject to be created.JsonObjectBuilderadd(java.lang.String name, long value)Add the given long value to the JsonObject to be created.JsonObjectBuilderadd(java.lang.String name, java.lang.String value)Add the given String value to the JsonObject to be created.JsonObjectBuilderadd(java.lang.String name, java.math.BigDecimal value)Add the given BigDecimal value to the JsonObject to be created.JsonObjectBuilderadd(java.lang.String name, java.math.BigInteger value)Add the given BigInteger value to the JsonObject to be created.JsonObjectBuilderadd(java.lang.String name, JsonArrayBuilder builder)Use the givenJsonArrayBuilderto create aJsonArraywhich will be added to the JsonObject to be created by this builder.JsonObjectBuilderadd(java.lang.String name, JsonObjectBuilder builder)Use the givenJsonObjectBuilderto create aJsonObjectwhich will be added to the JsonObject to be created by this builder.JsonObjectBuilderadd(java.lang.String name, JsonValue value)Add the given JsonValue value to the JsonObject to be created.default JsonObjectBuilderaddAll(JsonObjectBuilder builder)Add all of the attributes of the givenJsonObjectBuilderto the current oneJsonObjectBuilderaddNull(java.lang.String name)Add aJsonValue.NULLvalue to the JsonObject to be created.JsonObjectbuild()default JsonObjectBuilderremove(java.lang.String name)Remove the attribute with the given name from the builder.
-
-
-
Method Detail
-
add
JsonObjectBuilder add(java.lang.String name, JsonValue value)
Add the given JsonValue value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- the JsonValue to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, java.lang.String value)
Add the given String value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- the String value to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, java.math.BigInteger value)
Add the given BigInteger value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- the BigInteger value to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, java.math.BigDecimal value)
Add the given BigDecimal value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- the BigDecimal value to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, int value)
Add the given int value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, long value)
Add the given long value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, double value)
Add the given double value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, boolean value)
Add the given boolean value to the JsonObject to be created. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namevalue- to add- Returns:
- the current JsonObjectBuilder
-
addNull
JsonObjectBuilder addNull(java.lang.String name)
Add aJsonValue.NULLvalue to the JsonObject to be created. If a value with that name already exists it will be replaced by the null value.- Parameters:
name- the JSON attribute name- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, JsonObjectBuilder builder)
Use the givenJsonObjectBuilderto create aJsonObjectwhich will be added to the JsonObject to be created by this builder. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namebuilder- for creating the JsonObject to add- Returns:
- the current JsonObjectBuilder
-
add
JsonObjectBuilder add(java.lang.String name, JsonArrayBuilder builder)
Use the givenJsonArrayBuilderto create aJsonArraywhich will be added to the JsonObject to be created by this builder. If a value with that name already exists it will be replaced by the new value.- Parameters:
name- the JSON attribute namebuilder- for creating the JsonArray to add- Returns:
- the current JsonObjectBuilder
-
build
JsonObject build()
- Returns:
- a
JsonObjectbased on the added values.
-
addAll
default JsonObjectBuilder addAll(JsonObjectBuilder builder)
Add all of the attributes of the givenJsonObjectBuilderto the current one- Since:
- 1.1
-
remove
default JsonObjectBuilder remove(java.lang.String name)
Remove the attribute with the given name from the builder.- Since:
- 1.1
-
-