-
- All Implemented Interfaces:
-
com.firebase.ui.common.BaseSnapshotParser
public abstract class BaseCachingSnapshotParser<S, T> implements BaseSnapshotParser<S, T>
Implementation of BaseSnapshotParser that caches results, so parsing a snapshot repeatedly is not expensive.
-
-
Constructor Summary
Constructors Constructor Description BaseCachingSnapshotParser(BaseSnapshotParser<S, T> parser)
-
Method Summary
Modifier and Type Method Description abstract StringgetId(@NonNull() S snapshot)Get a unique identifier for a snapshot, should not depend on snapshot content. TparseSnapshot(@NonNull() S snapshot)This method parses the Snapshot into the requested type. voidclear()Clear all data in the cache. voidinvalidate(@NonNull() S snapshot)Invalidate the cache for a certain document. -
-
Constructor Detail
-
BaseCachingSnapshotParser
BaseCachingSnapshotParser(BaseSnapshotParser<S, T> parser)
-
-
Method Detail
-
getId
@NonNull() abstract String getId(@NonNull() S snapshot)
Get a unique identifier for a snapshot, should not depend on snapshot content.
-
parseSnapshot
@NonNull() T parseSnapshot(@NonNull() S snapshot)
This method parses the Snapshot into the requested type.
- Parameters:
snapshot- the Snapshot to extract the model from
-
clear
void clear()
Clear all data in the cache.
-
invalidate
void invalidate(@NonNull() S snapshot)
Invalidate the cache for a certain document.
-
-
-
-