Class Operator.AntiCompareMethod

java.lang.Object
org.apache.commons.jexl3.internal.Operator.CompareMethod
org.apache.commons.jexl3.internal.Operator.AntiCompareMethod
All Implemented Interfaces:
JexlMethod
Enclosing class:
Operator

private static class Operator.AntiCompareMethod extends Operator.CompareMethod
The reverse compare swaps left and right arguments and exploits the symmetry of compare as in: compare(a, b) &lt=&gt -compare(b, a)
  • Constructor Details

  • Method Details

    • invoke

      public Object invoke(Object arithmetic, Object... params) throws Exception
      Description copied from interface: JexlMethod
      Invocation method, called when the method invocation should be performed and a value returned.
      Specified by:
      invoke in interface JexlMethod
      Overrides:
      invoke in class Operator.CompareMethod
      Parameters:
      arithmetic - The object
      params - method parameters.
      Returns:
      The result
      Throws:
      Exception - on any error.
    • tryInvoke

      public Object tryInvoke(String name, Object arithmetic, Object... params) throws JexlException.TryFailed
      Description copied from interface: JexlMethod
      Attempts to reuse this JexlMethod, checking that it is compatible with the actual set of arguments. Related to isCacheable since this method is often used with cached JexlMethod instances.
      Specified by:
      tryInvoke in interface JexlMethod
      Overrides:
      tryInvoke in class Operator.CompareMethod
      Parameters:
      name - The method name
      arithmetic - The object to invoke the method upon
      params - The method arguments
      Returns:
      The result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.
      Throws:
      JexlException.TryFailed - if the underlying method was invoked but threw an exception (InvocationTargetException)