//todo: create a general supplier implementation which may be used for different purposes; alternative search for another implementation (e.g. npm)
/*
* Wrapper object to cache and load suppliers (see DatabaseSupplier_lib)
* Wrapper object to Wrap Suppliers. The supplied value is cached once at the first load. Every next access to the supplier will retrieve the cached value instead.
*
* @param {Supplier} pSupplier A supplier where the result will be cached.
*/
functionCachedSupplierWrapper(pSupplier)
{
//todo: assertion
//todo: assertion if the accepted pSupplier is really a supplier or if it is something else
this._supplier=pSupplier;
this._valueLoaded=false;
this._cache=null;
}
/**
* Retrieves the value of the supplier. If it is the first access, the origin Supplier is called, otherwise the cache is used
* @returns {*} Returns the value that is defined in the supplier.