Product - The type of the values to be provided.public interface Provider<Product>
Provider provides values of the corresponding product type.
Implementers may provide a new instance of the product each time
provide() is called, but aren't required to do so. An
instance of the product that has already been returned once, may be returned
again for any or all following calls.
A Provider is intended to be used in a situation, where a
mechanism to retrieve a value is more desirable than having the value from
the start. These are usually, but not necessarily, situations where the
following two conditions are met.
The second condition may only be true for the first call to
provide() since the Provider is allowed to
cache and reuse the value.
| Modifier and Type | Method and Description |
|---|---|
Product |
provide()
Provides a product, This may be a costly operation.
|
Product provide() throws ProvisioningException
Implementers should catch any exception and wrap them in a
ProvisioningException.
Implementers may provide a new instance of the product each time this method is called, but aren't required to do so. An instance of the product that has already been returned once, may be returned again in any or all following calls.
ProvisioningException - If the provisioning of the product failed.Copyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.