Class ImmutableHeaders.Builder

java.lang.Object
io.resys.hdes.client.api.ast.ImmutableHeaders.Builder
Enclosing class:
ImmutableHeaders

@NotThreadSafe public static final class ImmutableHeaders.Builder extends Object
Builds instances of type ImmutableHeaders. 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

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder from(AstBody.Headers instance)
      Fill a builder with attribute values from the provided Headers 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
    • addAcceptDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder addAcceptDefs(TypeDef element)
      Adds one element to acceptDefs list.
      Parameters:
      element - A acceptDefs element
      Returns:
      this builder for use in a chained invocation
    • addAcceptDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder addAcceptDefs(TypeDef... elements)
      Adds elements to acceptDefs list.
      Parameters:
      elements - An array of acceptDefs elements
      Returns:
      this builder for use in a chained invocation
    • acceptDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder acceptDefs(Iterable<? extends TypeDef> elements)
      Sets or replaces all elements for acceptDefs list.
      Parameters:
      elements - An iterable of acceptDefs elements
      Returns:
      this builder for use in a chained invocation
    • addAllAcceptDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder addAllAcceptDefs(Iterable<? extends TypeDef> elements)
      Adds elements to acceptDefs list.
      Parameters:
      elements - An iterable of acceptDefs elements
      Returns:
      this builder for use in a chained invocation
    • addReturnDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder addReturnDefs(TypeDef element)
      Adds one element to returnDefs list.
      Parameters:
      element - A returnDefs element
      Returns:
      this builder for use in a chained invocation
    • addReturnDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder addReturnDefs(TypeDef... elements)
      Adds elements to returnDefs list.
      Parameters:
      elements - An array of returnDefs elements
      Returns:
      this builder for use in a chained invocation
    • returnDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder returnDefs(Iterable<? extends TypeDef> elements)
      Sets or replaces all elements for returnDefs list.
      Parameters:
      elements - An iterable of returnDefs elements
      Returns:
      this builder for use in a chained invocation
    • addAllReturnDefs

      @CanIgnoreReturnValue public final ImmutableHeaders.Builder addAllReturnDefs(Iterable<? extends TypeDef> elements)
      Adds elements to returnDefs list.
      Parameters:
      elements - An iterable of returnDefs elements
      Returns:
      this builder for use in a chained invocation
    • build

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