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().

  • Method Details

    • name

      public Optional<String> name()
      Returns the optional name of the contact.
      Specified by:
      name in class Info.Contact
      Returns:
      the optional name of the contact
    • url

      public Optional<String> url()
      Returns the optional URL of the contact.
      Specified by:
      url in class Info.Contact
      Returns:
      the optional URL of the contact
    • email

      public Optional<String> email()
      Returns the optional email of the contact.
      Specified by:
      email in class Info.Contact
      Returns:
      the optional email of the contact
    • withName

      public final ImmutableContact withName(String value)
      Copy the current immutable object by setting a present value for the optional name attribute.
      Parameters:
      value - The value for name
      Returns:
      A modified copy or this if not changed
    • withName

      public final ImmutableContact withName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the name attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for name
      Returns:
      A modified copy or this if not changed
    • withUrl

      public final ImmutableContact withUrl(String value)
      Copy the current immutable object by setting a present value for the optional url attribute.
      Parameters:
      value - The value for url
      Returns:
      A modified copy or this if not changed
    • withUrl

      public final ImmutableContact withUrl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the url attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for url
      Returns:
      A modified copy or this if not changed
    • withEmail

      public final ImmutableContact withEmail(String value)
      Copy the current immutable object by setting a present value for the optional email attribute.
      Parameters:
      value - The value for email
      Returns:
      A modified copy or this if not changed
    • withEmail

      public final ImmutableContact withEmail(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the email attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for email
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableContact that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: name, url, email.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Contact with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableContact copyOf(Info.Contact instance)
      Creates an immutable copy of a Info.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

      public static ImmutableContact.Builder builder()
      Creates a builder for ImmutableContact.
       ImmutableContact.builder()
          .name(Optional<String>) // optional name
          .url(Optional<String>) // optional url
          .email(Optional<String>) // optional email
          .build();
       
      Returns:
      A new ImmutableContact builder