Package com.configcat

Class ConfigCache


  • public abstract class ConfigCache
    extends java.lang.Object
    A cache API used to make custom cache implementations for ConfigCatClient.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigCache()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      protected abstract java.lang.String read​(java.lang.String key)
      Child classes has to implement this method, the ConfigCatClient uses it to get the actual value from the cache.
      protected abstract void write​(java.lang.String key, java.lang.String value)
      * Child classes has to implement this method, the ConfigCatClient uses it to set the actual cached value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfigCache

        public ConfigCache()
    • Method Detail

      • read

        protected abstract java.lang.String read​(java.lang.String key)
                                          throws java.lang.Exception
        Child classes has to implement this method, the ConfigCatClient uses it to get the actual value from the cache.
        Parameters:
        key - the key of the cache entry.
        Returns:
        the cached configuration.
        Throws:
        java.lang.Exception - if unable to read the cache.
      • write

        protected abstract void write​(java.lang.String key,
                                      java.lang.String value)
                               throws java.lang.Exception
        * Child classes has to implement this method, the ConfigCatClient uses it to set the actual cached value.
        Parameters:
        key - the key of the cache entry.
        value - the new value to cache.
        Throws:
        java.lang.Exception - if unable to save the value.