Class ImmutableHeaders

java.lang.Object
io.resys.hdes.client.api.ast.ImmutableHeaders
All Implemented Interfaces:
AstBody.Headers, Serializable

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableHeaders extends Object implements AstBody.Headers
Immutable implementation of AstBody.Headers.

Use the builder to create immutable instances: ImmutableHeaders.builder().

See Also:
  • Method Details

    • getAcceptDefs

      public com.google.common.collect.ImmutableList<TypeDef> getAcceptDefs()
      Specified by:
      getAcceptDefs in interface AstBody.Headers
      Returns:
      The value of the acceptDefs attribute
    • getReturnDefs

      public com.google.common.collect.ImmutableList<TypeDef> getReturnDefs()
      Specified by:
      getReturnDefs in interface AstBody.Headers
      Returns:
      The value of the returnDefs attribute
    • withAcceptDefs

      public final ImmutableHeaders withAcceptDefs(TypeDef... elements)
      Copy the current immutable object with elements that replace the content of acceptDefs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAcceptDefs

      public final ImmutableHeaders withAcceptDefs(Iterable<? extends TypeDef> elements)
      Copy the current immutable object with elements that replace the content of acceptDefs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of acceptDefs elements to set
      Returns:
      A modified copy of this object
    • withReturnDefs

      public final ImmutableHeaders withReturnDefs(TypeDef... elements)
      Copy the current immutable object with elements that replace the content of returnDefs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withReturnDefs

      public final ImmutableHeaders withReturnDefs(Iterable<? extends TypeDef> elements)
      Copy the current immutable object with elements that replace the content of returnDefs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of returnDefs elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableHeaders 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: acceptDefs, returnDefs.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableHeaders copyOf(AstBody.Headers instance)
      Creates an immutable copy of a AstBody.Headers 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 Headers instance
    • builder

      public static ImmutableHeaders.Builder builder()
      Creates a builder for ImmutableHeaders.
       ImmutableHeaders.builder()
          .addAcceptDefs|addAllAcceptDefs(io.resys.hdes.client.api.ast.TypeDef) // acceptDefs elements
          .addReturnDefs|addAllReturnDefs(io.resys.hdes.client.api.ast.TypeDef) // returnDefs elements
          .build();
       
      Returns:
      A new ImmutableHeaders builder