Package dk.mada.jaxrs.model.api
Class ImmutableResponse.Builder
java.lang.Object
dk.mada.jaxrs.model.api.ImmutableResponse.Builder
- Enclosing class:
ImmutableResponse
@Generated(from="Response",
generator="Immutables")
public static final class ImmutableResponse.Builder
extends Object
Builds instances of type
ImmutableResponse
.
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 TypeMethodDescriptionbuild()
Builds a newImmutableResponse
.code
(StatusCode code) Initializes the value for thecode
attribute.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.Fill a builder with attribute values from the providedResponse
instance.
-
Method Details
-
from
Fill a builder with attribute values from the providedResponse
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
code
Initializes the value for thecode
attribute.- Parameters:
code
- The value for code- 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
-
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 newImmutableResponse
.- Returns:
- An immutable instance of Response
- Throws:
IllegalStateException
- if any required attributes are missing
-