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.Builderbuilder()Creates a builder forImmutableContent.static ImmutableContentCreates an immutable copy of aContentvalue.booleanThis instance is equal to all instances ofImmutableContentthat have equal attribute values.inthashCode()Computes a hash code from attributes:mediaTypes,reference.Returns the content media types supported.Returns the content type.toString()Prints the immutable valueContentwith attribute values.final ImmutableContentwithMediaTypes(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofmediaTypes.final ImmutableContentwithMediaTypes(String... elements) Copy the current immutable object with elements that replace the content ofmediaTypes.final ImmutableContentwithReference(Reference value) Copy the current immutable object by setting a value for thereferenceattribute.
-
Method Details
-
mediaTypes
Returns the content media types supported.- Specified by:
mediaTypesin 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
thisobject
-
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
thisif not changed
-
withReference
Copy the current immutable object by setting a value for thereferenceattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableContentthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:mediaTypes,reference. -
toString
Prints the immutable valueContentwith attribute values. -
copyOf
Creates an immutable copy of aContentvalue. 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) //mediaTypeselements .reference(dk.mada.jaxrs.model.types.Reference) // requiredreference.build();- Returns:
- A new ImmutableContent builder
-