Class McpJsonObject.Builder
java.lang.Object
com.soklet.McpJsonObject.Builder
- Enclosing class:
McpJsonObject
Mutable builder for
McpJsonObject.- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an immutable JSON object.put(@NonNull String name, @NonNull McpJsonValue value) Associates a member name with a JSON value.Associates a member name with a JSON boolean.Associates a member name with a finite JSON number.Associates a member name with an integral JSON number.Associates a member name with an integral JSON number.Associates a member name with a JSON string.put(@NonNull String name, @NonNull BigDecimal value) Associates a member name with an exactly represented JSON number.Associates a member name with the JSONnullvalue.
-
Method Details
-
put
Associates a member name with a JSON value.- Parameters:
name- the member namevalue- the member value- Returns:
- this builder
- Throws:
IllegalArgumentException- if the member name contains an unpaired surrogate
-
put
Associates a member name with a JSON string.- Parameters:
name- the member namevalue- the string value- Returns:
- this builder
- Throws:
IllegalArgumentException- if the name or value contains an unpaired surrogate
-
put
Associates a member name with an exactly represented JSON number.- Parameters:
name- the member namevalue- the number value- Returns:
- this builder
-
put
Associates a member name with an integral JSON number.- Parameters:
name- the member namevalue- the integer value- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis null
-
put
Associates a member name with an integral JSON number.- Parameters:
name- the member namevalue- the long value- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis null
-
put
Associates a member name with a finite JSON number.- Parameters:
name- the member namevalue- the finite double value- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis nullIllegalArgumentException- ifvalueis not finite
-
put
Associates a member name with a JSON boolean.- Parameters:
name- the member namevalue- the boolean value- Returns:
- this builder
- Throws:
NullPointerException- ifvalueis null
-
putNull
Associates a member name with the JSONnullvalue.- Parameters:
name- the member name- Returns:
- this builder
-
build
-