Esempio n. 1
0
 @Override
 public boolean apply() {
   if (!areBothDelegatesValid()) {
     return false;
   }
   if (firstDelegate.needsParameter()) {
     firstDelegate.invoke(secondDelegate.invoke());
     return true;
   } else if (secondDelegate.needsParameter()) {
     secondDelegate.invoke(firstDelegate.invoke());
     return true;
   }
   return false;
 }
Esempio n. 2
0
 protected boolean areBothDelegatesValid() {
   return firstDelegate.isValid() && secondDelegate.isValid();
 }