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.Builderbuilder()Creates a builder forImmutableInfo.contact()Returns the contact information for the API.static ImmutableInfoCreates an immutable copy of aInfovalue.Returns the optional description of the API.booleanThis instance is equal to all instances ofImmutableInfothat have equal attribute values.inthashCode()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 valueInfowith attribute values.version()Returns the version of the API.final ImmutableInfowithContact(Info.Contact value) Copy the current immutable object by setting a value for thecontactattribute.final ImmutableInfowithDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final ImmutableInfowithDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final ImmutableInfowithTermsOfService(String value) Copy the current immutable object by setting a present value for the optionaltermsOfServiceattribute.final ImmutableInfowithTermsOfService(Optional<String> optional) Copy the current immutable object by setting an optional value for thetermsOfServiceattribute.final ImmutableInfoCopy the current immutable object by setting a value for thetitleattribute.final ImmutableInfowithVersion(String value) Copy the current immutable object by setting a value for theversionattribute.
-
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:
descriptionin classInfo- Returns:
- the optional description of the API
-
termsOfService
Returns the optional TOS of the API.- Specified by:
termsOfServicein 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 thetitleattribute. 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
thisobject
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. 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
thisobject
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescriptionattribute.- Parameters:
value- The value for description- Returns:
- A modified copy or
thisif not changed
-
withDescription
Copy the current immutable object by setting an optional value for thedescriptionattribute. 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
thisif not changed
-
withTermsOfService
Copy the current immutable object by setting a present value for the optionaltermsOfServiceattribute.- Parameters:
value- The value for termsOfService- Returns:
- A modified copy or
thisif not changed
-
withTermsOfService
Copy the current immutable object by setting an optional value for thetermsOfServiceattribute. 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
thisif not changed
-
withContact
Copy the current immutable object by setting a value for thecontactattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableInfothat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:title,version,description,termsOfService,contact. -
toString
Prints the immutable valueInfowith attribute values. -
copyOf
Creates an immutable copy of aInfovalue. 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) // requiredtitle.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
-