| 程序包 | 说明 |
|---|---|
| net.hasor.cobble.provider |
提供 Supplier、Callable 的转换和包装
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
InstanceProvider<T>
对象的
Supplier封装形式。 |
class |
LoaderSingleProvider<T>
ClassLoader单例对象的
Supplier封装形式。 |
class |
SingleProvider<T>
单例对象的
Supplier封装形式。 |
class |
ThreadSingleProvider<T>
线程单例对象的
Supplier封装形式。 |
| 限定符和类型 | 方法和说明 |
|---|---|
default Provider<T> |
Provider.asLoader() |
static <T> Provider<T> |
Provider.asLoader(T target) |
default Provider<T> |
Provider.asSingle() |
default Provider<T> |
Provider.asThread() |
static <T> Provider<T> |
Provider.asThread(T target) |
static <T> Provider<T> |
Provider.of(Callable<T> callable) |
static <T> Provider<T> |
Provider.of(Supplier<T> supplier) |
static <T> Provider<T> |
Provider.of(T instance) |
static <T> Provider<T> |
Provider.toLoader(Callable<T> callable) |
static <T> Provider<T> |
Provider.toLoader(Supplier<T> supplier) |
static <T> Provider<T> |
Provider.toSingle(Callable<T> callable) |
static <T> Provider<T> |
Provider.toSingle(Supplier<T> supplier) |
static <T> Provider<T> |
Provider.toThread(Callable<T> callable) |
static <T> Provider<T> |
Provider.toThread(Supplier<T> supplier) |
static <T> Provider<T> |
Provider.wrap(T target) |
| 构造器和说明 |
|---|
LoaderSingleProvider(Provider<T> provider) |
SingleProvider(Provider<T> provider) |
ThreadSingleProvider(Provider<T> provider) |
Copyright © 2022. All rights reserved.