public class OptionalProviderFactory extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Optional<T> |
create(Provider<T> provider)
Creates from a provider if non-null.
|
public static <T> Optional<T> create(@Nullable Provider<T> provider) throws ProvisionFailedException
T
- type of optional as created by the providerprovider
- a provider or null (if it doesn't exist).Optional
.ProvisionFailedException
- if this is thrown during the call to Provider.get()
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.