Package org.anchoranalysis.bean
Class OptionalProviderFactory
Object
OptionalProviderFactory
- Author:
- Owen Feehan
-
Method Summary
-
Method Details
-
create
public static <T> Optional<T> create(@Nullable Provider<T> provider) throws ProvisionFailedException Creates from a provider if non-null.- Type Parameters:
T
- type of optional as created by the provider- Parameters:
provider
- a provider or null (if it doesn't exist).- Returns:
- the result of the create() option if provider is non-null, otherwise
Optional
. - Throws:
ProvisionFailedException
- if this is thrown during the call toProvider.get()
.
-