Class ImmutableAggregateFunctionReference

java.lang.Object
io.substrait.extendedexpression.ExtendedExpression.AggregateFunctionReference
io.substrait.extendedexpression.ImmutableAggregateFunctionReference
All Implemented Interfaces:
ExtendedExpression.ExpressionReferenceBase

public final class ImmutableAggregateFunctionReference extends ExtendedExpression.AggregateFunctionReference
Immutable implementation of ExtendedExpression.AggregateFunctionReference.

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

  • Method Details

    • getOutputNames

      public List<String> getOutputNames()
      Returns the output names associated with this reference.
      Returns:
      list of output names
    • getMeasure

      public Aggregate.Measure getMeasure()
      Returns the referenced aggregate measure.
      Specified by:
      getMeasure in class ExtendedExpression.AggregateFunctionReference
      Returns:
      the measure
    • withOutputNames

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

      public final ImmutableAggregateFunctionReference withOutputNames(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of outputNames. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of outputNames elements to set
      Returns:
      A modified copy or this if not changed
    • withMeasure

      public final ImmutableAggregateFunctionReference withMeasure(Aggregate.Measure value)
      Copy the current immutable object by setting a value for the measure attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for measure
      Returns:
      A modified copy or the this object
    • equals

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

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

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

      Creates a builder for ImmutableAggregateFunctionReference.
       ImmutableAggregateFunctionReference.builder()
          .addOutputNames|addAllOutputNames(String) // outputNames elements
          .measure(io.substrait.relation.Aggregate.Measure) // required measure
          .build();
       
      Returns:
      A new ImmutableAggregateFunctionReference builder