Class ImmutableBinaryOperator<T>

java.lang.Object
io.dialob.session.engine.program.expr.arith.ImmutableBinaryOperator<T>
All Implemented Interfaces:
BinaryOperator<T>, Expression, Serializable

@Generated(from="BinaryOperator", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableBinaryOperator<T> extends Object implements BinaryOperator<T>
Immutable implementation of BinaryOperator.

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

See Also:
  • Method Details

    • getNodes

      public com.google.common.collect.ImmutableList<Expression> getNodes()
      Specified by:
      getNodes in interface BinaryOperator<T>
      Returns:
      The value of the nodes attribute
    • getReducer

      public Reducer<T> getReducer()
      Specified by:
      getReducer in interface BinaryOperator<T>
      Returns:
      The value of the reducer attribute
    • withNodes

      public final ImmutableBinaryOperator<T> withNodes(Expression... elements)
      Copy the current immutable object with elements that replace the content of nodes.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withNodes

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

      public final ImmutableBinaryOperator<T> withReducer(Reducer<T> value)
      Copy the current immutable object by setting a value for the reducer attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for reducer
      Returns:
      A modified copy or the this object
    • equals

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

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

      public static <T> ImmutableBinaryOperator<T> copyOf(BinaryOperator<T> instance)
      Creates an immutable copy of a BinaryOperator value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      T - generic parameter T
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable BinaryOperator instance
    • builder

      public static <T> ImmutableBinaryOperator.Builder<T> builder()
      Creates a builder for ImmutableBinaryOperator.
       ImmutableBinaryOperator.<T>builder()
          .addNodes|addAllNodes(io.dialob.session.engine.program.model.Expression) // nodes elements
          .reducer(io.dialob.session.engine.program.expr.arith.Reducer<T>) // required reducer
          .build();
       
      Type Parameters:
      T - generic parameter T
      Returns:
      A new ImmutableBinaryOperator builder