Example usage for org.apache.commons.collections ClosureUtils exceptionClosure

List of usage examples for org.apache.commons.collections ClosureUtils exceptionClosure

Introduction

In this page you can find the example usage for org.apache.commons.collections ClosureUtils exceptionClosure.

Prototype

public static Closure exceptionClosure() 

Source Link

Document

Gets a Closure that always throws an exception.

Usage

From source file:ClosureExample.java

public static void main(String args[]) {
    Closure ifClosure = ClosureUtils.ifClosure(PredicateUtils.equalPredicate(new Integer(20)),
            ClosureUtils.nopClosure(), ClosureUtils.exceptionClosure());
    ifClosure.execute(new Integer(20));
    //      ifClosure.execute(new Integer(30));
}