Class ImmutableProperty.Builder

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

@Generated(from="Property", generator="Immutables") public static final class ImmutableProperty.Builder extends Object
Builds instances of type ImmutableProperty. 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 ImmutableProperty.Builder from(Property instance)
      Fill a builder with attribute values from the provided Property 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
    • name

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

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

      public final ImmutableProperty.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 ImmutableProperty.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
    • example

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

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

      public final ImmutableProperty.Builder validation(Validation validation)
      Initializes the value for the validation attribute.
      Parameters:
      validation - The value for validation
      Returns:
      this builder for use in a chained invocation
    • build

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