Class ImmutableInfo.Builder

java.lang.Object
dk.mada.jaxrs.model.ImmutableInfo.Builder
Enclosing class:
ImmutableInfo

@Generated(from="Info", generator="Immutables") public static final class ImmutableInfo.Builder extends Object
Builds instances of type ImmutableInfo. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      public final ImmutableInfo.Builder from(Info instance)
      Fill a builder with attribute values from the provided Info instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • title

      public final ImmutableInfo.Builder title(String title)
      Initializes the value for the title attribute.
      Parameters:
      title - The value for title
      Returns:
      this builder for use in a chained invocation
    • version

      public final ImmutableInfo.Builder version(String version)
      Initializes the value for the version attribute.
      Parameters:
      version - The value for version
      Returns:
      this builder for use in a chained invocation
    • description

      public final ImmutableInfo.Builder description(String description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for chained invocation
    • description

      public final ImmutableInfo.Builder description(Optional<String> description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for use in a chained invocation
    • termsOfService

      public final ImmutableInfo.Builder termsOfService(String termsOfService)
      Initializes the optional value termsOfService to termsOfService.
      Parameters:
      termsOfService - The value for termsOfService
      Returns:
      this builder for chained invocation
    • termsOfService

      public final ImmutableInfo.Builder termsOfService(Optional<String> termsOfService)
      Initializes the optional value termsOfService to termsOfService.
      Parameters:
      termsOfService - The value for termsOfService
      Returns:
      this builder for use in a chained invocation
    • contact

      public final ImmutableInfo.Builder contact(Info.Contact contact)
      Initializes the value for the contact attribute.

      If not set, this attribute will have a default value as returned by the initializer of contact.

      Parameters:
      contact - The value for contact
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableInfo build()
      Builds a new ImmutableInfo.
      Returns:
      An immutable instance of Info
      Throws:
      IllegalStateException - if any required attributes are missing