Class JsonRequest
- java.lang.Object
-
- io.helidon.integrations.common.rest.ApiJsonBuilder<T>
-
- io.helidon.integrations.common.rest.ApiJsonRequest<JsonRequest>
-
- io.helidon.integrations.common.rest.JsonRequest
-
- All Implemented Interfaces:
ApiRequest<JsonRequest>
public final class JsonRequest extends ApiJsonRequest<JsonRequest>
Implementation of aApiRequest
that allows free configuration of the JSON object.- See Also:
ApiJsonRequest
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonRequest
add(String name, boolean value)
Add custom boolean to payload.JsonRequest
add(String name, double value)
Add custom double to payload.JsonRequest
add(String name, int value)
Add custom int to payload.JsonRequest
add(String name, long value)
Add custom long to payload.JsonRequest
add(String name, ApiJsonBuilder<?> object)
Add a custom object to payload.JsonRequest
add(String name, String value)
Add custom string to payload.JsonRequest
addBase64(String name, Base64Value base64Value)
Add a string encoded with base64.JsonRequest
addToArray(String name, boolean element)
Add an element to an array.JsonRequest
addToArray(String name, double element)
Add an element to an array.JsonRequest
addToArray(String name, int element)
Add an element to an array.JsonRequest
addToArray(String name, long element)
Add an element to an array.JsonRequest
addToArray(String name, ApiJsonBuilder<?> element)
Add an object to an array.JsonRequest
addToArray(String name, String element)
Add an element to an array.JsonRequest
addToObject(String name, String key, boolean value)
Add a key/value pair to a named object.JsonRequest
addToObject(String name, String key, double value)
Add a key/value pair to a named object.JsonRequest
addToObject(String name, String key, int value)
Add a key/value pair to a named object.JsonRequest
addToObject(String name, String key, long value)
Add a key/value pair to a named object.JsonRequest
addToObject(String name, String key, String value)
Add a key/value pair to a named object.static JsonRequest
builder()
Create a new request builder.JsonRequest
emptyArray(String name)
Configure an empty array.-
Methods inherited from class io.helidon.integrations.common.rest.ApiJsonRequest
addHeader, addQueryParam, headers, queryParams, requestId, requestId, requestMediaType, requestMediaType, responseMediaType, responseMediaType
-
Methods inherited from class io.helidon.integrations.common.rest.ApiJsonBuilder
me, postBuild, preBuild, toJson
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.integrations.common.rest.ApiRequest
toJson
-
-
-
-
Method Detail
-
builder
public static JsonRequest builder()
Create a new request builder.- Returns:
- request builder
-
addToArray
public JsonRequest addToArray(String name, String element)
Description copied from class:ApiJsonBuilder
Add an element to an array.- Overrides:
addToArray
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- key in the json payloadelement
- element of the array- Returns:
- updated request
-
add
public JsonRequest add(String name, String value)
Description copied from class:ApiJsonBuilder
Add custom string to payload. If such a name is already added, it will be replaced.- Overrides:
add
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- json keyvalue
- json String value- Returns:
- updated request
-
add
public JsonRequest add(String name, int value)
Description copied from class:ApiJsonBuilder
Add custom int to payload. If such a name is already added, it will be replaced.- Overrides:
add
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- json keyvalue
- json value- Returns:
- updated request
-
add
public JsonRequest add(String name, double value)
Description copied from class:ApiJsonBuilder
Add custom double to payload. If such a name is already added, it will be replaced.- Overrides:
add
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- json keyvalue
- json value- Returns:
- updated request
-
add
public JsonRequest add(String name, boolean value)
Description copied from class:ApiJsonBuilder
Add custom boolean to payload. If such a name is already added, it will be replaced.- Overrides:
add
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- json keyvalue
- json value- Returns:
- updated request
-
emptyArray
public JsonRequest emptyArray(String name)
Description copied from class:ApiJsonBuilder
Configure an empty array.- Overrides:
emptyArray
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- name of the property- Returns:
- updated builder
-
addToArray
public JsonRequest addToArray(String name, ApiJsonBuilder<?> element)
Description copied from class:ApiJsonBuilder
Add an object to an array.- Overrides:
addToArray
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- name of the nested propertyelement
- aApiJsonBuilder
of the element of the array- Returns:
- updated builder
-
addToObject
public JsonRequest addToObject(String name, String key, String value)
Description copied from class:ApiJsonBuilder
Add a key/value pair to a named object.- Overrides:
addToObject
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- name of the object to create under the rootkey
- key of the nested propertyvalue
- value of the nested property- Returns:
- updated builder
-
addToArray
public JsonRequest addToArray(String name, int element)
Description copied from class:ApiJsonBuilder
Add an element to an array.- Overrides:
addToArray
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- key in the json payloadelement
- element of the array- Returns:
- updated request
-
addToArray
public JsonRequest addToArray(String name, long element)
Description copied from class:ApiJsonBuilder
Add an element to an array.- Overrides:
addToArray
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- key in the json payloadelement
- element of the array- Returns:
- updated request
-
addToArray
public JsonRequest addToArray(String name, double element)
Description copied from class:ApiJsonBuilder
Add an element to an array.- Overrides:
addToArray
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- key in the json payloadelement
- element of the array- Returns:
- updated request
-
addToArray
public JsonRequest addToArray(String name, boolean element)
Description copied from class:ApiJsonBuilder
Add an element to an array.- Overrides:
addToArray
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- key in the json payloadelement
- element of the array- Returns:
- updated request
-
add
public JsonRequest add(String name, long value)
Description copied from class:ApiJsonBuilder
Add custom long to payload. If such a name is already added, it will be replaced.- Overrides:
add
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- json keyvalue
- json value- Returns:
- updated request
-
addToObject
public JsonRequest addToObject(String name, String key, int value)
Description copied from class:ApiJsonBuilder
Add a key/value pair to a named object.- Overrides:
addToObject
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- name of the object to create under the rootkey
- key of the nested propertyvalue
- value of the nested property- Returns:
- updated builder
-
addToObject
public JsonRequest addToObject(String name, String key, long value)
Description copied from class:ApiJsonBuilder
Add a key/value pair to a named object.- Overrides:
addToObject
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- name of the object to create under the rootkey
- key of the nested propertyvalue
- value of the nested property- Returns:
- updated builder
-
addToObject
public JsonRequest addToObject(String name, String key, double value)
Description copied from class:ApiJsonBuilder
Add a key/value pair to a named object.- Overrides:
addToObject
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- name of the object to create under the rootkey
- key of the nested propertyvalue
- value of the nested property- Returns:
- updated builder
-
addToObject
public JsonRequest addToObject(String name, String key, boolean value)
Description copied from class:ApiJsonBuilder
Add a key/value pair to a named object.- Overrides:
addToObject
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- name of the object to create under the rootkey
- key of the nested propertyvalue
- value of the nested property- Returns:
- updated builder
-
add
public JsonRequest add(String name, ApiJsonBuilder<?> object)
Description copied from class:ApiJsonBuilder
Add a custom object to payload.- Overrides:
add
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- json keyobject
- json value- Returns:
- updated request
-
addBase64
public JsonRequest addBase64(String name, Base64Value base64Value)
Description copied from class:ApiJsonBuilder
Add a string encoded with base64.- Overrides:
addBase64
in classApiJsonBuilder<JsonRequest>
- Parameters:
name
- json keybase64Value
- base64 data- Returns:
- updated request
-
-