Class MethodCondition

  • All Implemented Interfaces:
    ICondition

    public class MethodCondition
    extends java.lang.Object
    implements ICondition
    Condition implementation that invokes a predefined method.
    • Constructor Summary

      Constructors 
      Constructor Description
      MethodCondition​(java.lang.Object object, java.lang.reflect.Method method)
      Create a new method condition.
      MethodCondition​(java.lang.Object object, java.lang.reflect.Method method, boolean invert)
      Create a new method condition.
      MethodCondition​(java.lang.Object object, java.lang.reflect.Method method, boolean invert, IMethodParameterGuesser guesser)
      Create a new method condition.
      MethodCondition​(java.lang.Object object, java.lang.reflect.Method method, IMethodParameterGuesser guesser)
      Create a new method condition.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IFuture<Tuple2<java.lang.Boolean,​java.lang.Object>> evaluate​(IEvent event)
      Evaluate the condition.
      protected java.lang.Object invokeMethod​(IEvent event)
      Do the method invocation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • object

        protected java.lang.Object object
        The object.
      • method

        protected java.lang.reflect.Method method
        The method.
      • invert

        protected boolean invert
        The invert flag. Inverts method result.
    • Constructor Detail

      • MethodCondition

        public MethodCondition​(java.lang.Object object,
                               java.lang.reflect.Method method)
        Create a new method condition.
      • MethodCondition

        public MethodCondition​(java.lang.Object object,
                               java.lang.reflect.Method method,
                               IMethodParameterGuesser guesser)
        Create a new method condition.
      • MethodCondition

        public MethodCondition​(java.lang.Object object,
                               java.lang.reflect.Method method,
                               boolean invert)
        Create a new method condition.
      • MethodCondition

        public MethodCondition​(java.lang.Object object,
                               java.lang.reflect.Method method,
                               boolean invert,
                               IMethodParameterGuesser guesser)
        Create a new method condition.
    • Method Detail

      • evaluate

        public IFuture<Tuple2<java.lang.Boolean,​java.lang.Object>> evaluate​(IEvent event)
        Evaluate the condition.
        Specified by:
        evaluate in interface ICondition
        Parameters:
        event - The event.
        Returns:
        True, if condition is met (plus additional user data).
      • invokeMethod

        protected java.lang.Object invokeMethod​(IEvent event)
                                         throws java.lang.Exception
        Do the method invocation.
        Throws:
        java.lang.Exception