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

  • Method Details

    • title

      public String title()
      Returns the title of the API.
      Specified by:
      title in class Info
      Returns:
      the title of the API
    • version

      public String version()
      Returns the version of the API.
      Specified by:
      version in class Info
      Returns:
      the version of the API
    • description

      public Optional<String> description()
      Returns the optional description of the API.
      Specified by:
      description in class Info
      Returns:
      the optional description of the API
    • termsOfService

      public Optional<String> termsOfService()
      Returns the optional TOS of the API.
      Specified by:
      termsOfService in class Info
      Returns:
      the optional TOS of the API
    • contact

      public Info.Contact contact()
      Returns the contact information for the API.
      Overrides:
      contact in class Info
      Returns:
      the contact information for the API
    • withTitle

      public final ImmutableInfo withTitle(String value)
      Copy the current immutable object by setting a value for the title attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for title
      Returns:
      A modified copy or the this object
    • withVersion

      public final ImmutableInfo withVersion(String value)
      Copy the current immutable object by setting a value for the version attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy or the this object
    • withDescription

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

      public final ImmutableInfo withDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the description 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 description
      Returns:
      A modified copy or this if not changed
    • withTermsOfService

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

      public final ImmutableInfo withTermsOfService(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the termsOfService 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 termsOfService
      Returns:
      A modified copy or this if not changed
    • withContact

      public final ImmutableInfo withContact(Info.Contact value)
      Copy the current immutable object by setting a value for the contact attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for contact
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableInfo 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: title, version, description, termsOfService, contact.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableInfo.Builder builder()
      Creates a builder for ImmutableInfo.
       ImmutableInfo.builder()
          .title(String) // required title
          .version(String) // required version
          .description(Optional<String>) // optional description
          .termsOfService(Optional<String>) // optional termsOfService
          .contact(dk.mada.jaxrs.model.Info.Contact) // optional contact
          .build();
       
      Returns:
      A new ImmutableInfo builder