Interface GroupCache<G,​K,​V>

  • Type Parameters:
    G - The group.
    K - The key.
    V - The value.
    All Known Implementing Classes:
    DefaultGroupCache

    public interface GroupCache<G,​K,​V>
    This GroupCache can cache group, key and value. The group and key are cache key, each key belongs to a certain group. All corresponding keys and values will be cleared if a group is cleared.
    • Method Detail

      • clear

        void clear()
        clear all cache.
      • get

        @Nullable
        V get​(G group,
              K key)
        Get value in cache.
        Returns:
        value in cache if exists, otherwise null
      • put

        void put​(G group,
                 K key,
                 V value)
        Put group, key and value to cache.
      • clearCacheForGroup

        void clearCacheForGroup​(G group)
        Clear all caches of the corresponding group.