Class ImmutableRuntimeConstraint

java.lang.Object
io.substrait.hint.Hint.RuntimeConstraint
io.substrait.hint.ImmutableRuntimeConstraint
All Implemented Interfaces:
HasExtension

public final class ImmutableRuntimeConstraint extends Hint.RuntimeConstraint
Immutable implementation of Hint.RuntimeConstraint.

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

  • Method Details

    • getExtension

      public Optional<AdvancedExtension> getExtension()
      Returns:
      the AdvancedExtension associated directly with the class
    • withExtension

      public final ImmutableRuntimeConstraint withExtension(AdvancedExtension value)
      Copy the current immutable object by setting a present value for the optional extension attribute.
      Parameters:
      value - The value for extension
      Returns:
      A modified copy or this if not changed
    • withExtension

      public final ImmutableRuntimeConstraint withExtension(Optional<? extends AdvancedExtension> optional)
      Copy the current immutable object by setting an optional value for the extension attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for extension
      Returns:
      A modified copy or this if not changed
    • equals

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

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

      public static ImmutableRuntimeConstraint copyOf(Hint.RuntimeConstraint instance)
      Creates an immutable copy of a Hint.RuntimeConstraint 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 RuntimeConstraint instance
    • builder

      public static ImmutableRuntimeConstraint.Builder builder()
      Creates a builder for ImmutableRuntimeConstraint.
       ImmutableRuntimeConstraint.builder()
          .extension(Optional<io.substrait.extension.AdvancedExtension>) // optional extension
          .build();
       
      Returns:
      A new ImmutableRuntimeConstraint builder