Package dk.mada.jaxrs.model.api
Class ImmutableRequestBody.Builder
java.lang.Object
dk.mada.jaxrs.model.api.ImmutableRequestBody.Builder
- Enclosing class:
ImmutableRequestBody
@Generated(from="RequestBody",
generator="Immutables")
public static final class ImmutableRequestBody.Builder
extends Object
Builds instances of type
ImmutableRequestBody
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllFormParameters
(Iterable<? extends Parameter> elements) Adds elements toformParameters
list.addFormParameters
(Parameter element) Adds one element toformParameters
list.addFormParameters
(Parameter... elements) Adds elements toformParameters
list.build()
Builds a newImmutableRequestBody
.Initializes the value for thecontent
attribute.description
(String description) Initializes the optional valuedescription
to description.description
(Optional<String> description) Initializes the optional valuedescription
to description.formParameters
(Iterable<? extends Parameter> elements) Sets or replaces all elements forformParameters
list.from
(RequestBody instance) Fill a builder with attribute values from the providedRequestBody
instance.isMultipartForm
(boolean isMultipartForm) Initializes the value for theisMultipartForm
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedRequestBody
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
content
Initializes the value for thecontent
attribute.- Parameters:
content
- The value for content- Returns:
this
builder for use in a chained invocation
-
addFormParameters
Adds one element toformParameters
list.- Parameters:
element
- A formParameters element- Returns:
this
builder for use in a chained invocation
-
addFormParameters
Adds elements toformParameters
list.- Parameters:
elements
- An array of formParameters elements- Returns:
this
builder for use in a chained invocation
-
formParameters
Sets or replaces all elements forformParameters
list.- Parameters:
elements
- An iterable of formParameters elements- Returns:
this
builder for use in a chained invocation
-
addAllFormParameters
public final ImmutableRequestBody.Builder addAllFormParameters(Iterable<? extends Parameter> elements) Adds elements toformParameters
list.- Parameters:
elements
- An iterable of formParameters elements- Returns:
this
builder for use in a chained invocation
-
isMultipartForm
Initializes the value for theisMultipartForm
attribute.- Parameters:
isMultipartForm
- The value for isMultipartForm- Returns:
this
builder for use in a chained invocation
-
description
Initializes the optional valuedescription
to description.- Parameters:
description
- The value for description- Returns:
this
builder for chained invocation
-
description
Initializes the optional valuedescription
to description.- Parameters:
description
- The value for description- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableRequestBody
.- Returns:
- An immutable instance of RequestBody
- Throws:
IllegalStateException
- if any required attributes are missing
-