java.lang.Object | +--org.apache.commons.collections.functors.SwitchClosureAll Implemented Interfaces:
SwitchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure) Constructor that performs no validation. |
void | execute(Object input) Execute the closure whose predicate returns true |
static Closure | getInstance(Predicate[] predicates, Closure[] closures, Closure defaultClosure) Factory method that performs validation and copies the parameter arrays. |
static Closure | getInstance(Map predicatesAndClosures) Create a new Closure that calls one of the closures depending on the predicates. |
public SwitchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure)
getInstance
if you want that.
public void execute(Object input)
public static Closure getInstance(Map predicatesAndClosures)
- if the map is null
- if any closure in the map is null
- if the map elements are of the wrong typepublic static Closure getInstance(Predicate[] predicates, Closure[] closures, Closure defaultClosure)
- if array is null
- if any element in the array is null