Package dk.mada.jaxrs.model.api
Class ImmutableContent
java.lang.Object
dk.mada.jaxrs.model.api.ImmutableContent
- All Implemented Interfaces:
Content
@Generated(from="Content",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableContent
extends Object
implements Content
Immutable implementation of
Content
.
Use the builder to create immutable instances:
ImmutableContent.builder()
.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableContent.Builder
builder()
Creates a builder forImmutableContent
.static ImmutableContent
Creates an immutable copy of aContent
value.boolean
This instance is equal to all instances ofImmutableContent
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:mediaTypes
,reference
.Returns the content media types supported.Returns the content type.toString()
Prints the immutable valueContent
with attribute values.final ImmutableContent
withMediaTypes
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofmediaTypes
.final ImmutableContent
withMediaTypes
(String... elements) Copy the current immutable object with elements that replace the content ofmediaTypes
.final ImmutableContent
withReference
(Reference value) Copy the current immutable object by setting a value for thereference
attribute.
-
Method Details
-
mediaTypes
Returns the content media types supported.- Specified by:
mediaTypes
in interfaceContent
- Returns:
- the content media types supported
-
reference
Returns the content type. -
withMediaTypes
Copy the current immutable object with elements that replace the content ofmediaTypes
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withMediaTypes
Copy the current immutable object with elements that replace the content ofmediaTypes
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of mediaTypes elements to set- Returns:
- A modified copy or
this
if not changed
-
withReference
Copy the current immutable object by setting a value for thereference
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for reference- Returns:
- A modified copy or the
this
object
-
equals
This instance is equal to all instances ofImmutableContent
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:mediaTypes
,reference
. -
toString
Prints the immutable valueContent
with attribute values. -
copyOf
Creates an immutable copy of aContent
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable Content instance
-
builder
Creates a builder forImmutableContent
.ImmutableContent.builder() .addMediaTypes|addAllMediaTypes(String) //
mediaTypes
elements .reference(dk.mada.jaxrs.model.types.Reference) // requiredreference
.build();- Returns:
- A new ImmutableContent builder
-