Class ImmutableExpand.SwitchingField

java.lang.Object
io.substrait.relation.Expand.SwitchingField
io.substrait.relation.ImmutableExpand.SwitchingField
All Implemented Interfaces:
Expand.ExpandField
Enclosing class:
ImmutableExpand

public static final class ImmutableExpand.SwitchingField extends Expand.SwitchingField
Immutable implementation of Expand.SwitchingField.

Use the builder to create immutable instances: ImmutableExpand.SwitchingField.builder().

  • Method Details

    • getDuplicates

      public List<Expression> getDuplicates()
      Returns the duplicate expressions this field may switch between.
      Specified by:
      getDuplicates in class Expand.SwitchingField
      Returns:
      list of duplicate expressions
    • withDuplicates

      public final ImmutableExpand.SwitchingField withDuplicates(Expression... elements)
      Copy the current immutable object with elements that replace the content of duplicates.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withDuplicates

      public final ImmutableExpand.SwitchingField withDuplicates(Iterable<? extends Expression> elements)
      Copy the current immutable object with elements that replace the content of duplicates. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of duplicates elements to set
      Returns:
      A modified copy or this if not changed
    • equals

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

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

      public static ImmutableExpand.SwitchingField copyOf(Expand.SwitchingField instance)
      Creates an immutable copy of a Expand.SwitchingField 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 SwitchingField instance
    • builder

      public static ImmutableExpand.SwitchingField.Builder builder()
      Creates a builder for SwitchingField.
       ImmutableExpand.SwitchingField.builder()
          .addDuplicates|addAllDuplicates(io.substrait.expression.Expression) // duplicates elements
          .build();
       
      Returns:
      A new SwitchingField builder