Initial import

Contains POM (probably incomplete) as well as all Throwing versions of
java.util.function interfaces + the Runnable interface.
This commit is contained in:
Emmanuel BENOîT 2015-09-11 13:59:02 +02:00
commit ec2c870f7b
48 changed files with 2427 additions and 0 deletions
src/main/java/info/ebenoit/ebul/func

View file

@ -0,0 +1,53 @@
package info.ebenoit.ebul.func;
import java.util.function.DoublePredicate;
/**
* This interface supports a {@link DoublePredicate} that can throw checked exceptions. Checked exceptions are
* transmitted using a {@link FunctionException} runtime exception.
*
* @author <a href="mailto:ebenoit@ebenoit.info">E. Benoît</a>
*/
@FunctionalInterface
public interface ThrowingDoublePredicate
extends DoublePredicate
{
/**
* Evaluates this predicate on the given argument.
*
* @param t
* the argument
* @return <code>true</code> if the input argument matches the predicate, otherwise <code>false</code>
* @throws FunctionException
* if a checked exception occurs
*/
@Override
default boolean test( final double t )
{
try {
return this.throwingTest( t );
} catch ( final RuntimeException e ) {
throw e;
} catch ( final Throwable e ) {
throw new FunctionException( e );
}
}
/**
* Evaluates this predicate on the given argument.
*
* @param t
* the argument
* @return <code>true</code> if the input argument matches the predicate, otherwise <code>false</code>
* @throws Throwable
* any exception
*/
public boolean throwingTest( double t )
throws Throwable;
}