Class FeatureProbe


  • public final class FeatureProbe
    extends Object
    A client for the FeatureProbe API. Client instances are thread-safe. Applications should instantiate a single FeatureProbe for the lifetime of their application.
    • Constructor Detail

      • FeatureProbe

        public FeatureProbe​(String serverSDKKey)
        Creates a new client instance that connects to FeatureProbe with the default configuration.
        Parameters:
        serverSDKKey - for your FeatureProbe environment
      • FeatureProbe

        public FeatureProbe​(String serverSDKKey,
                            FPConfig config)
        Creates a new client to connect to FeatureProbe with a custom configuration.
        Parameters:
        serverSDKKey - for your FeatureProbe environment
        config - the configuration control FeatureProbe client behavior
    • Method Detail

      • boolValue

        public boolean boolValue​(String toggleKey,
                                 FPUser user,
                                 boolean defaultValue)
        Get the evaluated value of a boolean toggle
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        Returns:
      • stringValue

        public String stringValue​(String toggleKey,
                                  FPUser user,
                                  String defaultValue)
        Get the evaluated value of a string toggle
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        Returns:
      • numberValue

        public double numberValue​(String toggleKey,
                                  FPUser user,
                                  double defaultValue)
        Get the evaluated value of a number toggle
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        Returns:
      • jsonValue

        public <T> T jsonValue​(String toggleKey,
                               FPUser user,
                               T defaultValue,
                               Class<T> clazz)
        Get the evaluated value of a json toggle
        Type Parameters:
        T -
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        clazz -
        Returns:
      • boolDetail

        public FPDetail<Boolean> boolDetail​(String toggleKey,
                                            FPUser user,
                                            boolean defaultValue)
        Get detailed evaluation results of boolean toggle
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        Returns:
      • stringDetail

        public FPDetail<String> stringDetail​(String toggleKey,
                                             FPUser user,
                                             String defaultValue)
        Get detailed evaluation results of string toggle
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        Returns:
      • numberDetail

        public FPDetail<Double> numberDetail​(String toggleKey,
                                             FPUser user,
                                             double defaultValue)
        Get detailed evaluation results of number toggle
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        Returns:
      • jsonDetail

        public <T> FPDetail<T> jsonDetail​(String toggleKey,
                                          FPUser user,
                                          T defaultValue,
                                          Class<T> clazz)
        Get detailed evaluation results of json toggle
        Type Parameters:
        T -
        Parameters:
        toggleKey -
        user - FPUser
        defaultValue -
        clazz -
        Returns:
      • flush

        public void flush()
        Manually events push
      • initialized

        public boolean initialized()
        Get FeatureProbe instance initial state
        Returns:
      • track

        public void track​(String eventName,
                          FPUser user)
        Tracks that a custom defined event
        Parameters:
        eventName - the name of the event
        user - FPUser
      • track

        public void track​(String eventName,
                          FPUser user,
                          double value)
        Tracks that a custom defined event, and provides an additional numeric value for custom event.
        Parameters:
        eventName - the name of the event
        user - FPUser
        value - a numeric value