Package com.configcat

Class ConfigCatHooks


  • public class ConfigCatHooks
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigCatHooks()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addOnClientReady​(java.lang.Runnable callback)
      Subscribes to the onReady event.
      void addOnConfigChanged​(java.util.function.Consumer<java.util.Map<java.lang.String,​com.configcat.Setting>> callback)
      Subscribes to the onConfigChanged event.
      void addOnError​(java.util.function.Consumer<java.lang.String> callback)
      Subscribes to the onError event.
      void addOnFlagEvaluated​(java.util.function.Consumer<EvaluationDetails<java.lang.Object>> callback)
      Subscribes to the onFlagEvaluated event.
      • Methods inherited from class java.lang.Object

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

      • ConfigCatHooks

        public ConfigCatHooks()
    • Method Detail

      • addOnClientReady

        public void addOnClientReady​(java.lang.Runnable callback)
        Subscribes to the onReady event. This event is fired when the SDK reaches the ready state. If the SDK is configured with lazy load or manual polling it's considered ready right after instantiation. In case of auto polling, the ready state is reached when the SDK has a valid config.json loaded into memory either from cache or from HTTP. If the config couldn't be loaded neither from cache nor from HTTP the onReady event fires when the auto polling's maxInitWaitTimeInSeconds is reached.
        Parameters:
        callback - the method to call when the event fires.
      • addOnConfigChanged

        public void addOnConfigChanged​(java.util.function.Consumer<java.util.Map<java.lang.String,​com.configcat.Setting>> callback)
        Subscribes to the onConfigChanged event. This event is fired when the SDK loads a valid config.json into memory from cache, and each subsequent time when the loaded config.json changes via HTTP.
        Parameters:
        callback - the method to call when the event fires.
      • addOnError

        public void addOnError​(java.util.function.Consumer<java.lang.String> callback)
        Subscribes to the onError event. This event is fired when an error occurs within the ConfigCat SDK.
        Parameters:
        callback - the method to call when the event fires.
      • addOnFlagEvaluated

        public void addOnFlagEvaluated​(java.util.function.Consumer<EvaluationDetails<java.lang.Object>> callback)
        Subscribes to the onFlagEvaluated event. This event is fired each time when the SDK evaluates a feature flag or setting. The event sends the same evaluation details that you would get from getValueDetails().
        Parameters:
        callback - the method to call when the event fires.