public class Cocoon extends Object
try {
myArrayList.forEach(Cocoon.consumer(MyClass::methodThatThrowsMyException)) ;
} catch (MyException exc) {
}
note that if an exception is fired the forEach will be terminated.| Constructor and Description |
|---|
Cocoon() |
| Modifier and Type | Method and Description |
|---|---|
static <X,T extends Throwable> |
consumer(TouchyConsumer<X,T> touchyConsumer)
creates an amiable Consumer out of a pesky one.
|
static <T extends Throwable> |
forgetThrowsClause(Throwable t)
this hack is to disable temporarily the compiler's control over checked exception.
|
static <X,R,T extends Throwable> |
function(TouchyFunction<X,R,T> touchyFunction) |
static <R,T extends Throwable> |
supplier(TouchySupplier<R,T> touchySupplier) |
public static <T extends Throwable> T forgetThrowsClause(Throwable t) throws T extends Throwable
T - t - TT extends Throwablepublic static <X,T extends Throwable> java.util.function.Consumer<X> consumer(TouchyConsumer<X,T> touchyConsumer) throws T extends Throwable
X - T - touchyConsumer - TT extends Throwablepublic static <X,R,T extends Throwable> java.util.function.Function<X,R> function(TouchyFunction<X,R,T> touchyFunction) throws T extends Throwable
T extends Throwablepublic static <R,T extends Throwable> java.util.function.Supplier<R> supplier(TouchySupplier<R,T> touchySupplier) throws T extends Throwable
T extends ThrowableCopyright © 2014 LSST. All rights reserved.