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.Builder
builder()
Creates a builder forImmutableContact
.static ImmutableContact
copyOf
(Info.Contact instance) Creates an immutable copy of aInfo.Contact
value.email()
Returns the optional email of the contact.boolean
This instance is equal to all instances ofImmutableContact
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:name
,url
,email
.name()
Returns the optional name of the contact.toString()
Prints the immutable valueContact
with attribute values.url()
Returns the optional URL of the contact.final ImmutableContact
Copy the current immutable object by setting a present value for the optionalemail
attribute.final ImmutableContact
Copy the current immutable object by setting an optional value for theemail
attribute.final ImmutableContact
Copy the current immutable object by setting a present value for the optionalname
attribute.final ImmutableContact
Copy the current immutable object by setting an optional value for thename
attribute.final ImmutableContact
Copy the current immutable object by setting a present value for the optionalurl
attribute.final ImmutableContact
Copy the current immutable object by setting an optional value for theurl
attribute.
-
Method Details
-
name
Returns the optional name of the contact.- Specified by:
name
in classInfo.Contact
- Returns:
- the optional name of the contact
-
url
Returns the optional URL of the contact.- Specified by:
url
in classInfo.Contact
- Returns:
- the optional URL of the contact
-
email
Returns the optional email of the contact.- Specified by:
email
in classInfo.Contact
- Returns:
- the optional email of the contact
-
withName
Copy the current immutable object by setting a present value for the optionalname
attribute.- Parameters:
value
- The value for name- Returns:
- A modified copy or
this
if not changed
-
withName
Copy the current immutable object by setting an optional value for thename
attribute. 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
this
if not changed
-
withUrl
Copy the current immutable object by setting a present value for the optionalurl
attribute.- Parameters:
value
- The value for url- Returns:
- A modified copy or
this
if not changed
-
withUrl
Copy the current immutable object by setting an optional value for theurl
attribute. 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
this
if not changed
-
withEmail
Copy the current immutable object by setting a present value for the optionalemail
attribute.- Parameters:
value
- The value for email- Returns:
- A modified copy or
this
if not changed
-
withEmail
Copy the current immutable object by setting an optional value for theemail
attribute. 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
this
if not changed
-
equals
This instance is equal to all instances ofImmutableContact
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name
,url
,email
. -
toString
Prints the immutable valueContact
with attribute values. -
copyOf
Creates an immutable copy of aInfo.Contact
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 Contact instance
-
builder
Creates a builder forImmutableContact
.ImmutableContact.builder() .name(Optional<String>) // optional
name
.url(Optional<String>) // optionalurl
.email(Optional<String>) // optionalemail
.build();- Returns:
- A new ImmutableContact builder
-