Class ImmutableAstBranch

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

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

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

See Also:
  • Method Details

    • getDescription

      @Nullable public String getDescription()
      Specified by:
      getDescription in interface AstBody
      Returns:
      The value of the description attribute
    • getHeaders

      public AstBody.Headers getHeaders()
      Specified by:
      getHeaders in interface AstBody
      Returns:
      The value of the headers attribute
    • getBodyType

      public AstBody.AstBodyType getBodyType()
      Specified by:
      getBodyType in interface AstBody
      Returns:
      The value of the bodyType attribute
    • getMessages

      public com.google.common.collect.ImmutableList<AstBody.AstCommandMessage> getMessages()
      Specified by:
      getMessages in interface AstBody
      Returns:
      The value of the messages attribute
    • getName

      public String getName()
      Specified by:
      getName in interface AstBody
      Specified by:
      getName in interface AstBranch
      Returns:
      The value of the name attribute
    • getCreated

      public LocalDateTime getCreated()
      Specified by:
      getCreated in interface AstBranch
      Returns:
      The value of the created attribute
    • getTagId

      public String getTagId()
      Specified by:
      getTagId in interface AstBranch
      Returns:
      The value of the tagId attribute
    • withDescription

      public final ImmutableAstBranch withDescription(@Nullable String value)
      Copy the current immutable object by setting a value for the description attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for description (can be null)
      Returns:
      A modified copy of the this object
    • withHeaders

      public final ImmutableAstBranch withHeaders(AstBody.Headers value)
      Copy the current immutable object by setting a value for the headers attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for headers
      Returns:
      A modified copy of the this object
    • withBodyType

      public final ImmutableAstBranch withBodyType(AstBody.AstBodyType value)
      Copy the current immutable object by setting a value for the bodyType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for bodyType
      Returns:
      A modified copy of the this object
    • withMessages

      public final ImmutableAstBranch withMessages(AstBody.AstCommandMessage... elements)
      Copy the current immutable object with elements that replace the content of messages.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMessages

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

      public final ImmutableAstBranch withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withCreated

      public final ImmutableAstBranch withCreated(LocalDateTime value)
      Copy the current immutable object by setting a value for the created attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for created
      Returns:
      A modified copy of the this object
    • withTagId

      public final ImmutableAstBranch withTagId(String value)
      Copy the current immutable object by setting a value for the tagId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tagId
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableAstBranch 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: description, headers, bodyType, messages, name, created, tagId.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableAstBranch copyOf(AstBranch instance)
      Creates an immutable copy of a AstBranch 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 AstBranch instance
    • builder

      public static ImmutableAstBranch.Builder builder()
      Creates a builder for ImmutableAstBranch.
       ImmutableAstBranch.builder()
          .description(String | null) // nullable description
          .headers(io.resys.hdes.client.api.ast.AstBody.Headers) // required headers
          .bodyType(io.resys.hdes.client.api.ast.AstBody.AstBodyType) // required bodyType
          .addMessages|addAllMessages(io.resys.hdes.client.api.ast.AstBody.AstCommandMessage) // messages elements
          .name(String) // required name
          .created(java.time.LocalDateTime) // required created
          .tagId(String) // required tagId
          .build();
       
      Returns:
      A new ImmutableAstBranch builder