Implement managed transactions
[mdsal.git] / binding / mdsal-binding-util / src / main / java / org / opendaylight / mdsal / binding / util / InterruptibleCheckedFunction.java
1 /*
2  * Copyright © 2018 Red Hat, Inc. and others.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.util;
9
10 /**
11  * {@link java.util.function.Function} which can throw a checked exception and be interrupted.
12  *
13  * @param <T> The type of the input to be processed.
14  * @param <R> The type of the result to be returned.
15  * @param <E> The type of the exception which may be thrown.
16  */
17 @FunctionalInterface
18 public interface InterruptibleCheckedFunction<T, R, E extends Exception> {
19     R apply(T input) throws E, InterruptedException;
20 }