Package com.featureprobe.sdk.server
Class FeatureProbe
- java.lang.Object
-
- com.featureprobe.sdk.server.FeatureProbe
-
public final class FeatureProbe extends Object
A client for the FeatureProbe API. Client instances are thread-safe. Applications should instantiate a singleFeatureProbe
for the lifetime of their application.
-
-
Constructor Summary
Constructors Constructor Description FeatureProbe(String serverSDKKey)
Creates a new client instance that connects to FeatureProbe with the default configuration.FeatureProbe(String serverSDKKey, FPConfig config)
Creates a new client to connect to FeatureProbe with a custom configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FPDetail<Boolean>
boolDetail(String toggleKey, FPUser user, boolean defaultValue)
Get detailed evaluation results of boolean toggleboolean
boolValue(String toggleKey, FPUser user, boolean defaultValue)
Get the evaluated value of a boolean togglevoid
close()
Safely shut down FeatureProbe instancevoid
flush()
Manually events pushboolean
initialized()
Get FeatureProbe instance initial state<T> FPDetail<T>
jsonDetail(String toggleKey, FPUser user, T defaultValue, Class<T> clazz)
Get detailed evaluation results of json toggle<T> T
jsonValue(String toggleKey, FPUser user, T defaultValue, Class<T> clazz)
Get the evaluated value of a json toggleFPDetail<Double>
numberDetail(String toggleKey, FPUser user, double defaultValue)
Get detailed evaluation results of number toggledouble
numberValue(String toggleKey, FPUser user, double defaultValue)
Get the evaluated value of a number toggleFPDetail<String>
stringDetail(String toggleKey, FPUser user, String defaultValue)
Get detailed evaluation results of string toggleString
stringValue(String toggleKey, FPUser user, String defaultValue)
Get the evaluated value of a string togglevoid
track(String eventName, FPUser user)
Tracks that a custom defined eventvoid
track(String eventName, FPUser user, double value)
Tracks that a custom defined event, and provides an additional numeric value for custom event.
-
-
-
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
-
-
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
-
close
public void close() throws IOException
Safely shut down FeatureProbe instance- Throws:
IOException
-
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 eventuser
-FPUser
-
-