E - type of object suppliedpublic class CachingSupplier<E> extends Object implements Supplier<E>
| Constructor and Description |
|---|
CachingSupplier(Supplier<? extends E> sourceSupplier,
Duration updateInterval)
Constructs an instance that wraps
sourceSupplier. |
CachingSupplier(Supplier<? extends E> sourceSupplier,
Duration updateInterval,
Clock clock)
Constructs an instance that wraps
sourceSupplier. |
public CachingSupplier(Supplier<? extends E> sourceSupplier, Duration updateInterval)
sourceSupplier.sourceSupplier - a supplier that will provide an up-to-date object each time it is called, that can be transformed into JSONupdateInterval - interval between calls to sourceSupplierpublic CachingSupplier(Supplier<? extends E> sourceSupplier, Duration updateInterval, Clock clock)
sourceSupplier. This constructor is intended for testing only.sourceSupplier - a supplier that will provide an up-to-date object each time it is called, that can be transformed into JSONupdateInterval - interval between calls to sourceSupplierclock - allows you to specify a different clock (for testing).Copyright © 2013–2020 Hotels.com. All rights reserved.