Package com.atlan.samples.loaders.caches
Class AssetCache
- java.lang.Object
-
- com.atlan.samples.loaders.caches.AssetCache
-
- Direct Known Subclasses:
CategoryCache
,GlossaryCache
,TermCache
public abstract class AssetCache extends java.lang.Object
Utility class for lazy-loading a cache of assets based on some human-constructable identity.
-
-
Constructor Summary
Constructors Constructor Description AssetCache()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.String identity)
Indicates whether the cache already contains an asset with a given identity.com.atlan.model.assets.Asset
get(java.lang.String identity)
Retrieve an asset from the cache, lazily-loading it on any cache misses.protected abstract com.atlan.model.assets.Asset
lookupAsset(java.lang.String identity)
Actually go to Atlan and find the asset with the provided identity.void
put(java.lang.String identity, com.atlan.model.assets.Asset asset)
Add an asset to the cache.
-
-
-
Method Detail
-
get
public com.atlan.model.assets.Asset get(java.lang.String identity)
Retrieve an asset from the cache, lazily-loading it on any cache misses.- Parameters:
identity
- of the asset to retrieve- Returns:
- the asset with the specified identity
-
put
public void put(java.lang.String identity, com.atlan.model.assets.Asset asset)
Add an asset to the cache.- Parameters:
identity
- of the asset to add to the cacheasset
- the asset to add to the cache
-
containsKey
public boolean containsKey(java.lang.String identity)
Indicates whether the cache already contains an asset with a given identity.- Parameters:
identity
- of the asset to check for presence in the cache- Returns:
- true if this identity is already in the cache, false otherwise
-
lookupAsset
protected abstract com.atlan.model.assets.Asset lookupAsset(java.lang.String identity)
Actually go to Atlan and find the asset with the provided identity.- Parameters:
identity
- of the asset to lookup- Returns:
- the asset, from Atlan itself
-
-