Package io.openems.common.utils
Class JsonUtils.JsonArrayBuilder
java.lang.Object
io.openems.common.utils.JsonUtils.JsonArrayBuilder
- Enclosing class:
- JsonUtils
A temporary builder class for JsonArrays.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(boolean value) Add a boolean value to theJsonArray
.add
(double value) Add a double value to theJsonArray
.add
(float value) Add a float value to theJsonArray
.add
(int value) Add a int value to theJsonArray
.add
(long value) Add a long value to theJsonArray
.add
(com.google.gson.JsonElement value) Add aJsonElement
value to theJsonArray
.Add a String value to theJsonArray
.com.google.gson.JsonArray
build()
Return the builtJsonArray
.
-
Constructor Details
-
JsonArrayBuilder
protected JsonArrayBuilder() -
JsonArrayBuilder
protected JsonArrayBuilder(com.google.gson.JsonArray j)
-
-
Method Details
-
add
Add a boolean value to theJsonArray
.- Parameters:
value
- the value- Returns:
- the
JsonUtils.JsonArrayBuilder
-
add
Add a int value to theJsonArray
.- Parameters:
value
- the value- Returns:
- the
JsonUtils.JsonArrayBuilder
-
add
Add a float value to theJsonArray
.- Parameters:
value
- the value- Returns:
- the
JsonUtils.JsonArrayBuilder
-
add
Add a double value to theJsonArray
.- Parameters:
value
- the value- Returns:
- the
JsonUtils.JsonArrayBuilder
-
add
Add aJsonElement
value to theJsonArray
.- Parameters:
value
- the value- Returns:
- the
JsonUtils.JsonArrayBuilder
-
add
Add a long value to theJsonArray
.- Parameters:
value
- the value- Returns:
- the
JsonUtils.JsonArrayBuilder
-
add
Add a String value to theJsonArray
.- Parameters:
value
- the value- Returns:
- the
JsonUtils.JsonArrayBuilder
-
build
public com.google.gson.JsonArray build()Return the builtJsonArray
.- Returns:
- the
JsonArray
-