public final class BannerCache extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
BannerCache.CacheDelegate
Optional delegate informing about events in BannerCache.
|
| Constructor and Description |
|---|
BannerCache(BannerCacheConfiguration cacheConfiguration)
Creates a cache of automatically preloaded banner ads.
|
| Modifier and Type | Method and Description |
|---|---|
BannerPlacementLayout |
consume()
Returns an instance of
BannerPlacementLayout to be used within the app. |
BannerPlacementLayout |
consume(boolean force)
Returns an instance of
BannerPlacementLayout to be used within the app. |
void |
destroy()
Destroys the BannerCache, clearing all preloaded banner ads and canceling pending reload requests.
|
String |
toString() |
void |
updateRequestConfiguration(BannerRequest requestConfiguration,
boolean shouldRefresh)
Updates the configuration that will be used when requesting new banners.
|
public BannerCache(BannerCacheConfiguration cacheConfiguration)
cacheConfiguration - BannerCacheConfiguration instance used to configure the cache.public void updateRequestConfiguration(BannerRequest requestConfiguration, boolean shouldRefresh)
requestConfiguration - BannerRequest instance. Can not be null.shouldRefresh - True if the whole cache should be re-loaded with new banner request configuration, false if new configuration should only be used for new requests.public BannerPlacementLayout consume()
BannerPlacementLayout to be used within the app. Also automatically counts an ad space.
BannerCache will no longer hold any references to returned banners, and they need to be destroyed manually by the app.
This method respects the frequency capping, set by BannerCacheConfiguration.setMinimumDelay(int)
BannerPlacementLayout instance.public BannerPlacementLayout consume(boolean force)
BannerPlacementLayout to be used within the app. Also automatically counts an ad space.
BannerCache will no longer hold any references to returned banners, and they need to be destroyed manually by the app.force - true if cache should try to return banner ignoring the frequency capping set by BannerCacheConfiguration.setMinimumDelay(int)BannerPlacementLayout instance.public void destroy()