Class MethodCallExpr

java.lang.Object
org.n52.svalbard.odata.core.expr.MethodCallExpr
All Implemented Interfaces:
ODataExpr, ArithmeticExpr, BooleanExpr, Expr, TemporalExpr, TextExpr

public class MethodCallExpr extends Object implements BooleanExpr, ArithmeticExpr, TemporalExpr, TextExpr
Class to hold a method call expression.
  • Constructor Details

    • MethodCallExpr

      public MethodCallExpr(String name, List<Expr> parameters)
      Create a new MethodCallExpr.
      Parameters:
      name - the method name
      parameters - the parameters
    • MethodCallExpr

      public MethodCallExpr(String name, Expr... parameter)
      Create a new MethodCallExpr.
      Parameters:
      name - the method name
      parameter - the parameter
  • Method Details

    • getName

      public String getName()
      Get the name of the method.
      Returns:
      the name
    • getParameters

      public List<Expr> getParameters()
      Get the parameters of this method call.
      Returns:
      the parameters
    • isMethodCall

      public boolean isMethodCall()
      Description copied from interface: Expr
      Check if this expression is a method call expression.
      Specified by:
      isMethodCall in interface Expr
      Returns:
      if it is a method call expression
    • asMethodCall

      public Optional<MethodCallExpr> asMethodCall()
      Description copied from interface: Expr
      Get this expression as a method call expression
      Specified by:
      asMethodCall 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
    • accept

      public <T, X extends Throwable> T accept(ExprVisitor<T,X> visitor) throws X
      Description copied from interface: Expr
      Accepts visitor for this expression.
      Specified by:
      accept in interface Expr
      Type Parameters:
      T - the visitor's return type
      X - the exception type the visitor may throw
      Parameters:
      visitor - the visitor
      Returns:
      the result of the visit
      Throws:
      X - if the visitor fails to visit this expression
    • hashCode

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

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