Class McpJsonArray.Builder
java.lang.Object
com.soklet.McpJsonArray.Builder
- Enclosing class:
McpJsonArray
Mutable builder for
McpJsonArray.- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionadd(@NonNull McpJsonValue value) Appends a JSON value.Appends a JSON boolean.Appends a finite JSON number.Appends an integral JSON number.Appends an integral JSON number.Appends a JSON string.add(@NonNull BigDecimal value) Appends an exactly represented JSON number.addNull()Appends the JSONnullvalue.build()Builds an immutable JSON array in append order.
-
Method Details
-
add
Appends a JSON value.- Parameters:
value- the value to append- Returns:
- this builder
-
add
Appends a JSON string.- Parameters:
value- the string value to append- Returns:
- this builder
-
add
Appends an exactly represented JSON number.- Parameters:
value- the number to append- Returns:
- this builder
-
add
Appends an integral JSON number.- Parameters:
value- the integer value to append- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis null
-
add
Appends an integral JSON number.- Parameters:
value- the long value to append- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis null
-
add
Appends a finite JSON number.- Parameters:
value- the finite double value to append- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis nullIllegalArgumentException- ifvalueis not finite
-
add
Appends a JSON boolean.- Parameters:
value- the boolean to append- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis null
-
addNull
-
build
Builds an immutable JSON array in append order.- Returns:
- the JSON array
-