X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.spring%2Fsrc%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2Ftasks%2FIf.java;fp=org.argeo.slc.spring%2Fsrc%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2Ftasks%2FIf.java;h=0000000000000000000000000000000000000000;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=f8a79d84849ae5abe4179ab9fedbdd30077e1f06;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.spring/src/org/argeo/slc/core/execution/tasks/If.java b/org.argeo.slc.spring/src/org/argeo/slc/core/execution/tasks/If.java deleted file mode 100644 index f8a79d848..000000000 --- a/org.argeo.slc.spring/src/org/argeo/slc/core/execution/tasks/If.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.argeo.slc.core.execution.tasks; - -import org.argeo.slc.SlcException; - -/** Conditional execution */ -public class If implements Runnable { - private Boolean is; - private Boolean not; - private Runnable then; - private Runnable els; - - public void run() { - if (is == null && not == null) - throw new SlcException("No condition set"); - if (is != null && not != null) - throw new SlcException("Both is and not cannot be set"); - - boolean bool = (is != null ? is : !not); - if (bool) { - if (then != null) - then.run(); - } else { - if (els != null) - els.run(); - } - - } - - public void setIs(Boolean bool) { - this.is = bool; - } - - public void setThen(Runnable then) { - this.then = then; - } - - public void setEls(Runnable els) { - this.els = els; - } - - public Boolean getNot() { - return not; - } - - public void setNot(Boolean not) { - this.not = not; - } - -}