Class BaseCachingSnapshotParser<S,​T>

    • Constructor Detail

      • BaseCachingSnapshotParser

        public BaseCachingSnapshotParser​(@NonNull
                                         BaseSnapshotParser<S,​T> parser)
    • Method Detail

      • getId

        @NonNull
        public abstract String getId​(@NonNull
                                     S snapshot)
        Get a unique identifier for a snapshot, should not depend on snapshot content.
      • parseSnapshot

        @NonNull
        public T parseSnapshot​(@NonNull
                               S snapshot)
        Description copied from interface: BaseSnapshotParser
        This method parses the Snapshot into the requested type.
        Specified by:
        parseSnapshot in interface BaseSnapshotParser<S,​T>
        Parameters:
        snapshot - the Snapshot to extract the model from
        Returns:
        the model extracted from the DataSnapshot
      • clear

        public void clear()
        Clear all data in the cache.
      • invalidate

        public void invalidate​(@NonNull
                               S snapshot)
        Invalidate the cache for a certain document.