| 1 |
/* |
| 2 |
* Copyright (c) 2016-present, RxJava Contributors. |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in |
| 5 |
* compliance with the License. You may obtain a copy of the License at |
| 6 |
* |
| 7 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
* |
| 9 |
* Unless required by applicable law or agreed to in writing, software distributed under the License is |
| 10 |
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See |
| 11 |
* the License for the specific language governing permissions and limitations under the License. |
| 12 |
*/ |
| 13 |
|
| 14 |
package io.reactivex.rxjava3.functions; |
| 15 |
|
| 16 |
/** |
| 17 |
* A functional interface (callback) that provides a single value or |
| 18 |
* throws an exception. |
| 19 |
* <p> |
| 20 |
* This interface was added to allow throwing any subclass of {@link Throwable}s, |
| 21 |
* which is not directly possible with the Java standard {@link java.util.concurrent.Callable} interface. |
| 22 |
* @param <T> the value type returned |
| 23 |
* @since 3.0.0 |
| 24 |
*/ |
| 25 |
@FunctionalInterface |
| 26 |
public interface Supplier<T> { |
| 27 |
|
| 28 |
/** |
| 29 |
* Produces a value or throws an exception. |
| 30 |
* @return the value produced |
| 31 |
* @throws Throwable if the implementation wishes to throw any type of exception |
| 32 |
*/ |
| 33 |
T get() throws Throwable; |
| 34 |
} |