Package dk.mada.jaxrs.model
Class ImmutableContact
java.lang.Object
dk.mada.jaxrs.model.Info.Contact
dk.mada.jaxrs.model.ImmutableContact
@Generated(from="Info.Contact",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableContact
extends Info.Contact
Immutable implementation of
Info.Contact.
Use the builder to create immutable instances:
ImmutableContact.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableContact.Builderbuilder()Creates a builder forImmutableContact.static ImmutableContactcopyOf(Info.Contact instance) Creates an immutable copy of aInfo.Contactvalue.email()Returns the optional email of the contact.booleanThis instance is equal to all instances ofImmutableContactthat have equal attribute values.inthashCode()Computes a hash code from attributes:name,url,email.name()Returns the optional name of the contact.toString()Prints the immutable valueContactwith attribute values.url()Returns the optional URL of the contact.final ImmutableContactCopy the current immutable object by setting a present value for the optionalemailattribute.final ImmutableContactCopy the current immutable object by setting an optional value for theemailattribute.final ImmutableContactCopy the current immutable object by setting a present value for the optionalnameattribute.final ImmutableContactCopy the current immutable object by setting an optional value for thenameattribute.final ImmutableContactCopy the current immutable object by setting a present value for the optionalurlattribute.final ImmutableContactCopy the current immutable object by setting an optional value for theurlattribute.
-
Method Details
-
name
Returns the optional name of the contact.- Specified by:
namein classInfo.Contact- Returns:
- the optional name of the contact
-
url
Returns the optional URL of the contact.- Specified by:
urlin classInfo.Contact- Returns:
- the optional URL of the contact
-
email
Returns the optional email of the contact.- Specified by:
emailin classInfo.Contact- Returns:
- the optional email of the contact
-
withName
Copy the current immutable object by setting a present value for the optionalnameattribute.- Parameters:
value- The value for name- Returns:
- A modified copy or
thisif not changed
-
withName
Copy the current immutable object by setting an optional value for thenameattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for name- Returns:
- A modified copy or
thisif not changed
-
withUrl
Copy the current immutable object by setting a present value for the optionalurlattribute.- Parameters:
value- The value for url- Returns:
- A modified copy or
thisif not changed
-
withUrl
Copy the current immutable object by setting an optional value for theurlattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for url- Returns:
- A modified copy or
thisif not changed
-
withEmail
Copy the current immutable object by setting a present value for the optionalemailattribute.- Parameters:
value- The value for email- Returns:
- A modified copy or
thisif not changed
-
withEmail
Copy the current immutable object by setting an optional value for theemailattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for email- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableContactthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,url,email. -
toString
Prints the immutable valueContactwith attribute values. -
copyOf
Creates an immutable copy of aInfo.Contactvalue. 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 Contact instance
-
builder
Creates a builder forImmutableContact.ImmutableContact.builder() .name(Optional<String>) // optionalname.url(Optional<String>) // optionalurl.email(Optional<String>) // optionalemail.build();- Returns:
- A new ImmutableContact builder
-