public final class Providers extends Object
Modifier and Type | Method and Description |
---|---|
static <T> javax.inject.Provider<T> |
fromSupplier(com.google.common.base.Supplier<T> supplier,
Class<T> type)
Convert a supplier to a provider.
|
static <T> javax.inject.Provider<T> |
memoize(javax.inject.Provider<T> inner) |
static <T> javax.inject.Provider<T> |
of(T object) |
static <T> javax.inject.Provider<T> |
of(T object,
Class<?> type) |
public static <T> javax.inject.Provider<T> of(@Nonnull T object)
public static <T> javax.inject.Provider<T> memoize(@Nonnull javax.inject.Provider<T> inner)
public static <T> javax.inject.Provider<T> fromSupplier(com.google.common.base.Supplier<T> supplier, Class<T> type)
T
- The type returned from the supplier.supplier
- The supplier.type
- The supplier's return type (to help the injector).Copyright © 2016 GroupLens Research. All rights reserved.