Package dk.mada.jaxrs.model.api
Class ImmutableContent.Builder
java.lang.Object
dk.mada.jaxrs.model.api.ImmutableContent.Builder
- Enclosing class:
ImmutableContent
@Generated(from="Content",
generator="Immutables")
public static final class ImmutableContent.Builder
extends Object
Builds instances of type
ImmutableContent
.
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 TypeMethodDescriptionfinal ImmutableContent.Builder
addAllMediaTypes
(Iterable<String> elements) Adds elements tomediaTypes
set.final ImmutableContent.Builder
addMediaTypes
(String element) Adds one element tomediaTypes
set.final ImmutableContent.Builder
addMediaTypes
(String... elements) Adds elements tomediaTypes
set.build()
Builds a newImmutableContent
.final ImmutableContent.Builder
Fill a builder with attribute values from the providedContent
instance.final ImmutableContent.Builder
mediaTypes
(Iterable<String> elements) Sets or replaces all elements formediaTypes
set.final ImmutableContent.Builder
Initializes the value for thereference
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedContent
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
-
addMediaTypes
Adds one element tomediaTypes
set.- Parameters:
element
- A mediaTypes element- Returns:
this
builder for use in a chained invocation
-
addMediaTypes
Adds elements tomediaTypes
set.- Parameters:
elements
- An array of mediaTypes elements- Returns:
this
builder for use in a chained invocation
-
mediaTypes
Sets or replaces all elements formediaTypes
set.- Parameters:
elements
- An iterable of mediaTypes elements- Returns:
this
builder for use in a chained invocation
-
addAllMediaTypes
Adds elements tomediaTypes
set.- Parameters:
elements
- An iterable of mediaTypes elements- Returns:
this
builder for use in a chained invocation
-
reference
Initializes the value for thereference
attribute.- Parameters:
reference
- The value for reference- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableContent
.- Returns:
- An immutable instance of Content
- Throws:
IllegalStateException
- if any required attributes are missing
-