public final class CachedVariantSource extends Object implements VariantSource
isCacheEmpty()
returns true. The cache starts empty and
can be cleared. The variant list this returns is unmodifiable.Constructor and Description |
---|
CachedVariantSource(VariantSource source)
Constructs a cached version of the variant source.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache of any variants.
|
List<Variant> |
getVariants()
Get the variants from the variant source.
|
boolean |
isCacheEmpty()
Returns true when there are no cached variants.
|
public CachedVariantSource(VariantSource source)
source
- Underlying variant sourcepublic List<Variant> getVariants() throws VariantSourceException
VariantSource
getVariants
in interface VariantSource
VariantSourceException
- Thrown when unable to return the variantsVariantSourceConfigurationException
- Thrown when the variant source is not configuredpublic boolean isCacheEmpty()
public void clearCache()
getVariants()
will cause the
underlying source to provide a new list.Copyright © 2016. All Rights Reserved.