Class ImmutableAstCommandMessage

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

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

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

See Also:
  • Method Details

    • getLine

      public int getLine()
      Specified by:
      getLine in interface AstBody.AstCommandMessage
      Returns:
      The value of the line attribute
    • getValue

      public String getValue()
      Specified by:
      getValue in interface AstBody.AstCommandMessage
      Returns:
      The value of the value attribute
    • getType

      public AstBody.CommandMessageType getType()
      Specified by:
      getType in interface AstBody.AstCommandMessage
      Returns:
      The value of the type attribute
    • getRange

      @Nullable public AstBody.AstCommandRange getRange()
      Specified by:
      getRange in interface AstBody.AstCommandMessage
      Returns:
      The value of the range attribute
    • withLine

      public final ImmutableAstCommandMessage withLine(int value)
      Copy the current immutable object by setting a value for the line attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for line
      Returns:
      A modified copy of the this object
    • withValue

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

      Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy of the this object
    • withRange

      public final ImmutableAstCommandMessage withRange(@Nullable AstBody.AstCommandRange value)
      Copy the current immutable object by setting a value for the range attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for range (can be null)
      Returns:
      A modified copy of the this object
    • equals

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

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

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

      public static ImmutableAstCommandMessage.Builder builder()
      Creates a builder for ImmutableAstCommandMessage.
       ImmutableAstCommandMessage.builder()
          .line(int) // required line
          .value(String) // required value
          .type(io.resys.hdes.client.api.ast.AstBody.CommandMessageType) // required type
          .range(io.resys.hdes.client.api.ast.AstBody.AstCommandRange | null) // nullable range
          .build();
       
      Returns:
      A new ImmutableAstCommandMessage builder