Package dk.mada.jaxrs.model
Class ImmutableInfo
java.lang.Object
dk.mada.jaxrs.model.Info
dk.mada.jaxrs.model.ImmutableInfo
@Generated(from="Info",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableInfo
extends Info
Immutable implementation of
Info
.
Use the builder to create immutable instances:
ImmutableInfo.builder()
.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class dk.mada.jaxrs.model.Info
Info.Contact
-
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableInfo.Builder
builder()
Creates a builder forImmutableInfo
.contact()
Returns the contact information for the API.static ImmutableInfo
Creates an immutable copy of aInfo
value.Returns the optional description of the API.boolean
This instance is equal to all instances ofImmutableInfo
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:title
,version
,description
,termsOfService
,contact
.Returns the optional TOS of the API.title()
Returns the title of the API.toString()
Prints the immutable valueInfo
with attribute values.version()
Returns the version of the API.final ImmutableInfo
withContact
(Info.Contact value) Copy the current immutable object by setting a value for thecontact
attribute.final ImmutableInfo
withDescription
(String value) Copy the current immutable object by setting a present value for the optionaldescription
attribute.final ImmutableInfo
withDescription
(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescription
attribute.final ImmutableInfo
withTermsOfService
(String value) Copy the current immutable object by setting a present value for the optionaltermsOfService
attribute.final ImmutableInfo
withTermsOfService
(Optional<String> optional) Copy the current immutable object by setting an optional value for thetermsOfService
attribute.final ImmutableInfo
Copy the current immutable object by setting a value for thetitle
attribute.final ImmutableInfo
withVersion
(String value) Copy the current immutable object by setting a value for theversion
attribute.
-
Method Details
-
title
Returns the title of the API. -
version
Returns the version of the API. -
description
Returns the optional description of the API.- Specified by:
description
in classInfo
- Returns:
- the optional description of the API
-
termsOfService
Returns the optional TOS of the API.- Specified by:
termsOfService
in classInfo
- Returns:
- the optional TOS of the API
-
contact
Returns the contact information for the API. -
withTitle
Copy the current immutable object by setting a value for thetitle
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for title- Returns:
- A modified copy or the
this
object
-
withVersion
Copy the current immutable object by setting a value for theversion
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for version- Returns:
- A modified copy or the
this
object
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescription
attribute.- Parameters:
value
- The value for description- Returns:
- A modified copy or
this
if not changed
-
withDescription
Copy the current immutable object by setting an optional value for thedescription
attribute. An equality check is used on inner value to prevent copying of the same value by returningthis
.- Parameters:
optional
- An optional value for description- Returns:
- A modified copy or
this
if not changed
-
withTermsOfService
Copy the current immutable object by setting a present value for the optionaltermsOfService
attribute.- Parameters:
value
- The value for termsOfService- Returns:
- A modified copy or
this
if not changed
-
withTermsOfService
Copy the current immutable object by setting an optional value for thetermsOfService
attribute. An equality check is used on inner value to prevent copying of the same value by returningthis
.- Parameters:
optional
- An optional value for termsOfService- Returns:
- A modified copy or
this
if not changed
-
withContact
Copy the current immutable object by setting a value for thecontact
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for contact- Returns:
- A modified copy or the
this
object
-
equals
This instance is equal to all instances ofImmutableInfo
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:title
,version
,description
,termsOfService
,contact
. -
toString
Prints the immutable valueInfo
with attribute values. -
copyOf
Creates an immutable copy of aInfo
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 Info instance
-
builder
Creates a builder forImmutableInfo
.ImmutableInfo.builder() .title(String) // required
title
.version(String) // requiredversion
.description(Optional<String>) // optionaldescription
.termsOfService(Optional<String>) // optionaltermsOfService
.contact(dk.mada.jaxrs.model.Info.Contact) // optionalcontact
.build();- Returns:
- A new ImmutableInfo builder
-