Package net.bitnine.agensgraph.util
Class JsonbArrayBuilder
java.lang.Object
net.bitnine.agensgraph.util.JsonbArrayBuilder
A builder for creating Jsonb array.
This class initializes a Jsonb array and provides methods to add values to the array
and to return the resulting array.
The methods in this class can be chained to add multiple values to the array.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(boolean value) Adds a value to the array as a boolean.add(double value) Adds a value to the array as a double.add(long value) Adds a value to the array as a long.Adds a value to the array as an object.Adds a value to the array as a string.Adds a value to the array as a Jsonb.add(JsonbArrayBuilder builder) Adds a JsonbArray from an array builder to the array.add(JsonbObjectBuilder builder) Adds a JsonbObject from an array builder to the array.addNull()Adds a value to the array as a null.build()Returns the Jsonb array associated with this array builder.
-
Constructor Details
-
JsonbArrayBuilder
public JsonbArrayBuilder()Initializes a Jsonb array.
-
-
Method Details
-
add
Adds a value to the array as a string.- Parameters:
value- the string value- Returns:
- this array builder
-
add
Adds a value to the array as a long.- Parameters:
value- the long value- Returns:
- this array builder
-
add
Adds a value to the array as a double.- Parameters:
value- the double value- Returns:
- this array builder
-
add
Adds a value to the array as a boolean.- Parameters:
value- the boolean value- Returns:
- this array builder
-
addNull
Adds a value to the array as a null.- Returns:
- this array builder
-
add
Adds a value to the array as a Jsonb.- Parameters:
j- the Jsonb value- Returns:
- this array builder
-
add
Adds a value to the array as an object.- Parameters:
value- the object value- Returns:
- this array builder
-
add
Adds a JsonbArray from an array builder to the array.- Parameters:
builder- the array builder- Returns:
- this array builder
-
add
Adds a JsonbObject from an array builder to the array.- Parameters:
builder- the object builder- Returns:
- this array builder
-
build
Returns the Jsonb array associated with this array builder.- Returns:
- the Jsonb array that is being built
-