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 toformParameterslist.addFormParameters(Parameter element) Adds one element toformParameterslist.addFormParameters(Parameter... elements) Adds elements toformParameterslist.build()Builds a newImmutableRequestBody.Initializes the value for thecontentattribute.description(String description) Initializes the optional valuedescriptionto description.description(Optional<String> description) Initializes the optional valuedescriptionto description.formParameters(Iterable<? extends Parameter> elements) Sets or replaces all elements forformParameterslist.from(RequestBody instance) Fill a builder with attribute values from the providedRequestBodyinstance.isMultipartForm(boolean isMultipartForm) Initializes the value for theisMultipartFormattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedRequestBodyinstance. 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:
thisbuilder for use in a chained invocation
-
content
Initializes the value for thecontentattribute.- Parameters:
content- The value for content- Returns:
thisbuilder for use in a chained invocation
-
addFormParameters
Adds one element toformParameterslist.- Parameters:
element- A formParameters element- Returns:
thisbuilder for use in a chained invocation
-
addFormParameters
Adds elements toformParameterslist.- Parameters:
elements- An array of formParameters elements- Returns:
thisbuilder for use in a chained invocation
-
formParameters
Sets or replaces all elements forformParameterslist.- Parameters:
elements- An iterable of formParameters elements- Returns:
thisbuilder for use in a chained invocation
-
addAllFormParameters
public final ImmutableRequestBody.Builder addAllFormParameters(Iterable<? extends Parameter> elements) Adds elements toformParameterslist.- Parameters:
elements- An iterable of formParameters elements- Returns:
thisbuilder for use in a chained invocation
-
isMultipartForm
Initializes the value for theisMultipartFormattribute.- Parameters:
isMultipartForm- The value for isMultipartForm- Returns:
thisbuilder for use in a chained invocation
-
description
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableRequestBody.- Returns:
- An immutable instance of RequestBody
- Throws:
IllegalStateException- if any required attributes are missing
-