Class ImmutableContent.Builder

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

@Generated(from="Content", generator="Immutables") public static final class ImmutableContent.Builder extends Object
Builds instances of type ImmutableContent. 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 ImmutableContent.Builder from(Content instance)
      Fill a builder with attribute values from the provided Content instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • addMediaTypes

      public final ImmutableContent.Builder addMediaTypes(String element)
      Adds one element to mediaTypes set.
      Parameters:
      element - A mediaTypes element
      Returns:
      this builder for use in a chained invocation
    • addMediaTypes

      public final ImmutableContent.Builder addMediaTypes(String... elements)
      Adds elements to mediaTypes set.
      Parameters:
      elements - An array of mediaTypes elements
      Returns:
      this builder for use in a chained invocation
    • mediaTypes

      public final ImmutableContent.Builder mediaTypes(Iterable<String> elements)
      Sets or replaces all elements for mediaTypes set.
      Parameters:
      elements - An iterable of mediaTypes elements
      Returns:
      this builder for use in a chained invocation
    • addAllMediaTypes

      public final ImmutableContent.Builder addAllMediaTypes(Iterable<String> elements)
      Adds elements to mediaTypes set.
      Parameters:
      elements - An iterable of mediaTypes elements
      Returns:
      this builder for use in a chained invocation
    • reference

      public final ImmutableContent.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
    • build

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