Class BinaryExpr<T>

java.lang.Object
org.n52.svalbard.odata.core.expr.BinaryExpr<T>
Type Parameters:
T - the operator type
All Implemented Interfaces:
ODataExpr, Expr
Direct Known Subclasses:
BooleanBinaryExpr, ComparisonExpr, SimpleArithmeticExpr

public abstract class BinaryExpr<T> extends Object implements Expr
Class to hold a binary expression.
  • Constructor Details

    • BinaryExpr

      public BinaryExpr(T operator, Expr left, Expr right)
      Create a new BinaryExpr.
      Parameters:
      operator - the operator
      left - the left operand
      right - the right operand
  • Method Details

    • getOperator

      public T getOperator()
      Get the operator.
      Returns:
      the operator
    • getLeft

      public Expr getLeft()
      Get the left operand.
      Returns:
      the left operand
    • getRight

      public Expr getRight()
      Get the right operand.
      Returns:
      the right operand
    • isBinary

      public boolean isBinary()
      Description copied from interface: Expr
      Check if this expression is a binary expression.
      Specified by:
      isBinary in interface Expr
      Returns:
      if it is a binary expression
    • asBinary

      public Optional<BinaryExpr<?>> asBinary()
      Description copied from interface: Expr
      Get this expression as a binary expression
      Specified by:
      asBinary in interface Expr
      Returns:
      the expression or Optional.empty() if the type does not match
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toODataString

      public String toODataString()
      Specified by:
      toODataString in interface ODataExpr
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object