public final class OptimisticNormalizedCache extends NormalizedCache
Constructor and Description |
---|
OptimisticNormalizedCache() |
Modifier and Type | Method and Description |
---|---|
void |
clearAll()
Clears all records from the cache.
|
java.util.Map<java.lang.Class,java.util.Map<java.lang.String,Record>> |
dump() |
Record |
loadRecord(java.lang.String key,
CacheHeaders cacheHeaders) |
java.util.Set<java.lang.String> |
mergeOptimisticUpdate(Record record) |
java.util.Set<java.lang.String> |
mergeOptimisticUpdates(java.util.Collection<Record> recordSet) |
protected java.util.Set<java.lang.String> |
performMerge(Record apolloRecord,
CacheHeaders cacheHeaders) |
boolean |
remove(CacheKey cacheKey,
boolean cascade)
Remove cached record by the key
|
java.util.Set<java.lang.String> |
removeOptimisticUpdates(java.util.UUID mutationId) |
chain, loadRecords, merge, merge, nextCache, prettifyDump, remove
@Nullable public Record loadRecord(@NotNull java.lang.String key, @NotNull CacheHeaders cacheHeaders)
loadRecord
in class NormalizedCache
key
- The key of the record to read.cacheHeaders
- The cache headers associated with the request which generated this record.Record
for key. If not present return null.public void clearAll()
NormalizedCache
ApolloClient.clearNormalizedCache()
for a thread-safe access to this method.clearAll
in class NormalizedCache
public boolean remove(@NotNull CacheKey cacheKey, boolean cascade)
NormalizedCache
remove
in class NormalizedCache
cacheKey
- of record to be removedcascade
- defines if remove operation is propagated to the referenced entitiestrue
if record with such key was successfully removed, false
otherwise@NotNull public java.util.Set<java.lang.String> mergeOptimisticUpdates(@NotNull java.util.Collection<Record> recordSet)
@NotNull public java.util.Set<java.lang.String> mergeOptimisticUpdate(@NotNull Record record)
@NotNull public java.util.Set<java.lang.String> removeOptimisticUpdates(@NotNull java.util.UUID mutationId)
@NotNull protected java.util.Set<java.lang.String> performMerge(@NotNull Record apolloRecord, @NotNull CacheHeaders cacheHeaders)
performMerge
in class NormalizedCache
public java.util.Map<java.lang.Class,java.util.Map<java.lang.String,Record>> dump()
dump
in class NormalizedCache