public interface SplitClient
| Modifier and Type | Method and Description |
|---|---|
void |
blockUntilReady()
The SDK kicks off background threads to download data necessary
for using the SDK.
|
void |
destroy()
Destroys the background processes and clears the cache, releasing the resources used by
the any instances of SplitClient or SplitManager generated by the client's parent SplitFactory
|
String |
getTreatment(Key key,
String split,
Map<String,Object> attributes)
To understand why this method is useful, consider the following simple Split as an example:
if user is in segment employees then split 100%:on
else if user is in segment all then split 20%:on,80%:off
There are two concepts here: matching and bucketing.
|
String |
getTreatment(String key,
String split)
Returns the treatment to show this key for this feature.
|
String |
getTreatment(String key,
String split,
Map<String,Object> attributes)
This method is useful when you want to determine the treatment to show
to an customer (user, account etc.) based on an attribute of that customer
instead of it's key.
|
SplitResult |
getTreatmentWithConfig(Key key,
String split,
Map<String,Object> attributes)
Same as
getTreatment(Key, String, Map) but it returns the configuration associated to the
matching treatment if any. |
SplitResult |
getTreatmentWithConfig(String key,
String split)
Same as
getTreatment(String, String) but it returns the configuration associated to the
matching treatment if any. |
SplitResult |
getTreatmentWithConfig(String key,
String split,
Map<String,Object> attributes)
Same as
getTreatment(String, String, Map) but it returns the configuration associated to the
matching treatment if any. |
boolean |
track(String key,
String trafficType,
String eventType)
Enqueue a new event to be sent to split data collection services
Example:
client.track(“account”, “Split Software”, “checkout”)
|
boolean |
track(String key,
String trafficType,
String eventType,
double value)
Enqueue a new event to be sent to split data collection services
Example:
client.track(“account”, “Split Software”, “checkout”, 200.00)
|
boolean |
track(String key,
String trafficType,
String eventType,
double value,
Map<String,Object> properties)
Enqueue a new event to be sent to split data collection services
Example:
client.track(“account”, “Split Software”, “checkout”, 123, Collections.singletonMap("age", 23))
|
boolean |
track(String key,
String trafficType,
String eventType,
Map<String,Object> properties)
Enqueue a new event to be sent to split data collection services
Example:
client.track(“account”, “Split Software”, “checkout”, Collections.singletonMap("age", 23))
|
String getTreatment(String key, String split)
key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.split - the feature we want to evaluate. MUST NOT be null.String getTreatment(String key, String split, Map<String,Object> attributes)
key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.split - the feature we want to evaluate. MUST NOT be null.attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.String getTreatment(Key key, String split, Map<String,Object> attributes)
key - the matching and bucketing keys. MUST NOT be null.split - the feature we want to evaluate. MUST NOT be null.attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.SplitResult getTreatmentWithConfig(String key, String split)
getTreatment(String, String) but it returns the configuration associated to the
matching treatment if any. Otherwise SplitResult.configurations() will be null.
Examples include showing a different treatment to users on trial plan
vs. premium plan. Another example is to show a different treatment
to users created after a certain date.key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.split - the feature we want to evaluate. MUST NOT be null.SplitResult getTreatmentWithConfig(String key, String split, Map<String,Object> attributes)
getTreatment(String, String, Map) but it returns the configuration associated to the
matching treatment if any. Otherwise SplitResult.configurations() will be null.
Examples include showing a different treatment to users on trial plan
vs. premium plan. Another example is to show a different treatment
to users created after a certain date.key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.split - the feature we want to evaluate. MUST NOT be null.attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.SplitResult getTreatmentWithConfig(Key key, String split, Map<String,Object> attributes)
getTreatment(Key, String, Map) but it returns the configuration associated to the
matching treatment if any. Otherwise SplitResult.configurations() will be null.key - the matching and bucketing keys. MUST NOT be null.split - the feature we want to evaluate. MUST NOT be null.attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.void destroy()
boolean track(String key, String trafficType, String eventType)
key - the identifier of the entitytrafficType - the type of the eventeventType - the type of the eventboolean track(String key, String trafficType, String eventType, double value)
key - the identifier of the entitytrafficType - the type of the eventeventType - the type of the eventvalue - the value of the eventboolean track(String key, String trafficType, String eventType, Map<String,Object> properties)
key - the identifier of the entitytrafficType - the type of the eventeventType - the type of the eventvalue - the value of the eventboolean track(String key, String trafficType, String eventType, double value, Map<String,Object> properties)
key - the identifier of the entitytrafficType - the type of the eventeventType - the type of the eventvalue - the value of the eventvoid blockUntilReady()
throws TimeoutException,
InterruptedException
If the download is not successful in the time period set on
SplitClientConfig.Builder.setBlockUntilReadyTimeout(int), a TimeoutException will be thrown.
TimeoutExceptionInterruptedExceptionCopyright © 2019. All rights reserved.