public final class Instantiators extends Object
Instantiator
s.Modifier and Type | Method and Description |
---|---|
static Instantiator |
memoize(Instantiator instantiator)
Memoize an instantiator.
|
static Instantiator |
ofInstance(Object inst)
Create an instantiator that returns an instance.
|
static Instantiator |
ofNull(Class<?> type)
Create an instantiator that returns a null value.
|
static Instantiator |
ofProvider(javax.inject.Provider<?> provider)
Convert a providerInstantiator to an instantiator.
|
static Instantiator |
ofProviderInstantiator(Instantiator pinst)
Flatten an instnatiator of providers into an instantiator of the provided type.
|
static javax.inject.Provider<?> |
toProvider(Instantiator instantiator)
Convert an instantiator to a provider.
|
public static Instantiator ofInstance(Object inst)
inst
- The instance to return (must be non-null).inst
.public static Instantiator ofNull(Class<?> type)
type
- The type of null value to return.null
.public static Instantiator ofProvider(javax.inject.Provider<?> provider)
ConstructionException
.provider
- The providerInstantiator to wrap.providerInstantiator
.public static Instantiator ofProviderInstantiator(Instantiator pinst)
ConstructionException
.pinst
- The providerInstantiator instantiator to wrap.providerInstantiator
.public static javax.inject.Provider<?> toProvider(Instantiator instantiator)
instantiator
- The instantiator to convert.Provider.get()
method invokes the instantiator.public static Instantiator memoize(Instantiator instantiator)
instantiator
- The instantiator to memoize.instantiator
.Copyright © 2016 GroupLens Research. All rights reserved.