Class ImmutableExpressionResult

java.lang.Object
io.resys.hdes.client.api.programs.ImmutableExpressionResult
All Implemented Interfaces:
ExpressionProgram.ExpressionResult, Program.ProgramResult, Serializable

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

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

See Also:
  • Method Details

    • getType

      public TypeDef.ValueType getType()
      Specified by:
      getType in interface ExpressionProgram.ExpressionResult
      Returns:
      The value of the type attribute
    • getConstants

      public com.google.common.collect.ImmutableList<String> getConstants()
      Specified by:
      getConstants in interface ExpressionProgram.ExpressionResult
      Returns:
      The value of the constants attribute
    • getValue

      @Nullable public Object getValue()
      Specified by:
      getValue in interface ExpressionProgram.ExpressionResult
      Returns:
      The value of the value attribute
    • withType

      public final ImmutableExpressionResult withType(TypeDef.ValueType value)
      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
    • withConstants

      public final ImmutableExpressionResult withConstants(String... elements)
      Copy the current immutable object with elements that replace the content of constants.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withConstants

      public final ImmutableExpressionResult withConstants(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of constants. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of constants elements to set
      Returns:
      A modified copy of this object
    • withValue

      public final ImmutableExpressionResult withValue(@Nullable Object value)
      Copy the current immutable object by setting a value for the value attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for value (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 ImmutableExpressionResult 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: type, constants, value.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a ExpressionProgram.ExpressionResult 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 ExpressionResult instance
    • builder

      public static ImmutableExpressionResult.Builder builder()
      Creates a builder for ImmutableExpressionResult.
       ImmutableExpressionResult.builder()
          .type(io.resys.hdes.client.api.ast.TypeDef.ValueType) // required type
          .addConstants|addAllConstants(String) // constants elements
          .value(Object | null) // nullable value
          .build();
       
      Returns:
      A new ImmutableExpressionResult builder