suparnatural-cache / com.suparnatural.core.cache / CacheStore / preprocessors

preprocessors

abstract val preprocessors: List<CacheStorePreprocessor<Cacheable, Cacheable, Cacheable>>?

Chain of preprocessors to archive and unarchive Cacheable objects. While persisting, the preprocessors are applied to the incoming Cacheable instance and are expected to return an archived Cacheable instance. Before archiving, a CacheStore always adds a special CacheStorePreprocessor at the end of the preprocessors chain which outputs a RawCacheable.

While reading an object for the persistence, the preprocessors are applied in a reverse order. The store first unarchives the read content into a RawCacheable and then passes to the last (or first preprocessor in reversed preprocessors chain) preprocessor in the chain moving its way back to the first (or the last in reverse preprocessors chain).