Package com.transifex.txnative.cache
Class TxUpdateFilterCache
java.lang.Object
com.transifex.txnative.cache.TxDecoratorCache
com.transifex.txnative.cache.TxUpdateFilterCache
- All Implemented Interfaces:
TxCache
Decorator class that updates the internal cache using a certain update policy when the
update(LocaleData.TranslationMap)
method is called.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Update policy that specifies the way that the internal cache is updated with new translations. -
Field Summary
Fields inherited from class com.transifex.txnative.cache.TxDecoratorCache
mInternalCache
-
Constructor Summary
ConstructorDescriptionTxUpdateFilterCache
(int policy, TxCache internalCache) Creates a new instance having the providedTxCacheUpdatePolicy
and internal cache. -
Method Summary
Modifier and TypeMethodDescriptionvoid
update
(LocaleData.TranslationMap translationMap) Updates the internal cache with the provided translations using the update policy specified in the constructor.Methods inherited from class com.transifex.txnative.cache.TxDecoratorCache
get, get
-
Constructor Details
-
TxUpdateFilterCache
Creates a new instance having the providedTxCacheUpdatePolicy
and internal cache.- Parameters:
policy
- One of the availableupdate policies
.internalCache
- The internal cache to be used.
-
-
Method Details
-
update
Updates the internal cache with the provided translations using the update policy specified in the constructor.Note that after calculating the new translations with the current update policy, the internal cache's
TxCache.update(LocaleData.TranslationMap)
method is called to set them. Depending on the cache's implementation, the actual result may be different to the calculated one.- Specified by:
update
in interfaceTxCache
- Overrides:
update
in classTxDecoratorCache
-