@FunctionalInterface public interface Provider<T> extends Supplier<T>, Callable<T>
| 限定符和类型 | 方法和说明 |
|---|---|
default Provider<T> |
asLoader() |
static <T> Provider<T> |
asLoader(T target) |
default Provider<T> |
asSingle() |
default Provider<T> |
asThread() |
static <T> Provider<T> |
asThread(T target) |
T |
call()
Computes a result, or throws an exception if unable to do so.
|
default T |
get()
Gets a result.
|
static <T> Provider<T> |
of(Callable<T> callable) |
static <T> Provider<T> |
of(Supplier<T> supplier) |
static <T> Provider<T> |
of(T instance) |
static <T> Provider<T> |
toLoader(Callable<T> callable) |
static <T> Provider<T> |
toLoader(Supplier<T> supplier) |
static <T> Provider<T> |
toSingle(Callable<T> callable) |
static <T> Provider<T> |
toSingle(Supplier<T> supplier) |
static <T> Provider<T> |
toThread(Callable<T> callable) |
static <T> Provider<T> |
toThread(Supplier<T> supplier) |
static <T> Provider<T> |
wrap(T target) |
Copyright © 2022–2023. All rights reserved.