Class SplitClientImpl

  • All Implemented Interfaces:
    SplitClient

    public final class SplitClientImpl
    extends Object
    implements SplitClient
    A basic implementation of SplitClient.
    Author:
    adil
    • Method Detail

      • getTreatment

        public String getTreatment​(String key,
                                   String featureFlagName)
        Description copied from interface: SplitClient
        Returns the treatment to show this key for this feature flag. The set of treatments for a feature flag can be configured on the Split user interface.

        This method returns the string 'control' if:

        1. Any of the parameters were null
        2. There was an exception in evaluating the treatment
        3. The SDK does not know of the existence of this feature flag
        4. The feature flag was deleted through the Split user interface.
        'control' is a reserved treatment (you cannot create a treatment with the same name) to highlight these exceptional circumstances.

        The sdk returns the default treatment of this feature flag if:

        1. The feature flag was killed
        2. The key did not match any of the conditions in the feature flag roll-out plan
        The default treatment of a feature flag is set on the Split user interface.

        This method does not throw any exceptions. It also never returns null.

        Specified by:
        getTreatment in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatment

        public String getTreatment​(String key,
                                   String featureFlagName,
                                   Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        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.

        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.

        Specified by:
        getTreatment in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatment

        public String getTreatment​(Key key,
                                   String featureFlagName,
                                   Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        To understand why this method is useful, consider the following simple Feature Flag as an example: if user is in segment employees then feature flag 100%:on else if user is in segment all then feature flag 20%:on,80%:off There are two concepts here: matching and bucketing. Matching refers to ‘user is in segment employees’ or ‘user is in segment all’ whereas bucketing refers to ‘100%:on’ or ‘20%:on,80%:off’. By default, the same customer key is used for both matching and bucketing. However, for some advanced use cases, you may want to use different keys. For such cases, use this method. As an example, suppose you want to rollout to percentages of users in specific accounts. You can achieve that by matching via account id, but bucketing by user id. Another example is when you want to ensure that a user continues to get the same treatment after they sign up for your product that they used to get when they were simply a visitor to your site. In that case, before they sign up, you can use their visitor id for both matching and bucketing, but post log-in you can use their user id for matching and visitor id for bucketing.
        Specified by:
        getTreatment in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentWithConfig

        public SplitResult getTreatmentWithConfig​(String key,
                                                  String featureFlagName)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatment(String, String) but it returns the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        Returns:
        SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentWithConfig

        public SplitResult getTreatmentWithConfig​(String key,
                                                  String featureFlagName,
                                                  Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatment(String, String, Map) but it returns the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentWithConfig

        public SplitResult getTreatmentWithConfig​(Key key,
                                                  String featureFlagName,
                                                  Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatment(Key, String, Map) but it returns the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} will be null.
        Specified by:
        getTreatmentWithConfig in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatments

        public Map<String,​String> getTreatments​(String key,
                                                      List<String> featureFlagNames)
        Description copied from interface: SplitClient
        Returns a map of feature flag name and treatments to show this key for these feature flags. The set of treatments for a feature flag can be configured on the Split user interface.

        This method returns for each feature flag the string 'control' if:

        1. Any of the parameters were null
        2. There was an exception in evaluating the treatment
        3. The SDK does not know of the existence of this feature flag
        4. The feature flag was deleted through the Split user interface.
        'control' is a reserved treatment (you cannot create a treatment with the same name) to highlight these exceptional circumstances.

        The sdk returns for each feature flag the default treatment of this feature flag if:

        1. The feature flag was killed
        2. The key did not match any of the conditions in the feature flag roll-out plan
        The default treatment of a feature flag is set on the Split user interface.

        This method does not throw any exceptions. It also never returns null.

        Specified by:
        getTreatments in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        Returns:
        for each feature flag the evaluated treatment, the default treatment for each feature flag, or 'control'.
      • getTreatments

        public Map<String,​String> getTreatments​(String key,
                                                      List<String> featureFlagNames,
                                                      Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        This method is useful when you want to determine the treatments to show to a customer (user, account etc.) based on an attribute of that customer instead of their key.

        Examples include showing different treatments to users on trial plan vs. premium plan. Another example is to show different treatments to users created after a certain date.

        Specified by:
        getTreatments in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatments

        public Map<String,​String> getTreatments​(Key key,
                                                      List<String> featureFlagNames,
                                                      Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        To understand why this method is useful, consider the following simple Feature Flag as an example: if user is in segment employees then feature flag 100%:on else if user is in segment all then feature flag 20%:on,80%:off There are two concepts here: matching and bucketing. Matching refers to ‘user is in segment employees’ or ‘user is in segment all’ whereas bucketing refers to ‘100%:on’ or ‘20%:on,80%:off’. By default, the same customer key is used for both matching and bucketing. However, for some advanced use cases, you may want to use different keys. For such cases, use this method. As an example, suppose you want to rollout to percentages of users in specific accounts. You can achieve that by matching via account id, but bucketing by user id. Another example is when you want to ensure that a user continues to get the same treatment after they sign up for your product that they used to get when they were simply a visitor to your site. In that case, before they sign up, you can use their visitor id for both matching and bucketing, but post log-in you can use their user id for matching and visitor id for bucketing.
        Specified by:
        getTreatments in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment, the default treatment of the feature flag, or 'control'.
      • getTreatmentsWithConfig

        public Map<String,​SplitResult> getTreatmentsWithConfig​(String key,
                                                                     List<String> featureFlagNames)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List) but it returns the configuration associated to the matching treatments if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        Returns:
        Map containing for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfig

        public Map<String,​SplitResult> getTreatmentsWithConfig​(String key,
                                                                     List<String> featureFlagNames,
                                                                     Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag a SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfig

        public Map<String,​SplitResult> getTreatmentsWithConfig​(Key key,
                                                                     List<String> featureFlagNames,
                                                                     Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatments(Key, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} will be null.
        Specified by:
        getTreatmentsWithConfig in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag a SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsByFlagSet

        public Map<String,​String> getTreatmentsByFlagSet​(String key,
                                                               String flagSet)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSet

        public Map<String,​String> getTreatmentsByFlagSet​(String key,
                                                               String flagSet,
                                                               Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSet

        public Map<String,​String> getTreatmentsByFlagSet​(Key key,
                                                               String flagSet,
                                                               Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSet in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSets

        public Map<String,​String> getTreatmentsByFlagSets​(String key,
                                                                List<String> flagSets)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSets

        public Map<String,​String> getTreatmentsByFlagSets​(String key,
                                                                List<String> flagSets,
                                                                Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSets

        public Map<String,​String> getTreatmentsByFlagSets​(Key key,
                                                                List<String> flagSets,
                                                                Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSets in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsWithConfigByFlagSet

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSet​(String key,
                                                                              String flagSet)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSet

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSet​(String key,
                                                                              String flagSet,
                                                                              Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSet

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSet​(Key key,
                                                                              String flagSet,
                                                                              Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSet in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSets

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSets​(String key,
                                                                               List<String> flagSets)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSets

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSets​(String key,
                                                                               List<String> flagSets,
                                                                               Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSets

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSets​(Key key,
                                                                               List<String> flagSets,
                                                                               Map<String,​Object> attributes)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSets in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatment

        public String getTreatment​(String key,
                                   String featureFlagName,
                                   EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Returns the treatment to show this key for this feature flag. The set of treatments for a feature flag can be configured on the Split user interface.

        This method returns the string 'control' if:

        1. Any of the parameters were null
        2. There was an exception in evaluating the treatment
        3. The SDK does not know of the existence of this feature flag
        4. The feature flag was deleted through the Split user interface.
        'control' is a reserved treatment (you cannot create a treatment with the same name) to highlight these exceptional circumstances.

        The sdk returns the default treatment of this feature flag if:

        1. The feature flag was killed
        2. The key did not match any of the conditions in the feature flag roll-out plan
        The default treatment of a feature flag is set on the Split user interface.

        This method does not throw any exceptions. It also never returns null.

        Specified by:
        getTreatment in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        evaluationOptions - additional data for evaluation.
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatment

        public String getTreatment​(String key,
                                   String featureFlagName,
                                   Map<String,​Object> attributes,
                                   EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        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.

        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.

        Specified by:
        getTreatment in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatment

        public String getTreatment​(Key key,
                                   String featureFlagName,
                                   Map<String,​Object> attributes,
                                   EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        To understand why this method is useful, consider the following simple Feature Flag as an example: if user is in segment employees then feature flag 100%:on else if user is in segment all then feature flag 20%:on,80%:off There are two concepts here: matching and bucketing. Matching refers to ‘user is in segment employees’ or ‘user is in segment all’ whereas bucketing refers to ‘100%:on’ or ‘20%:on,80%:off’. By default, the same customer key is used for both matching and bucketing. However, for some advanced use cases, you may want to use different keys. For such cases, use this method. As an example, suppose you want to rollout to percentages of users in specific accounts. You can achieve that by matching via account id, but bucketing by user id. Another example is when you want to ensure that a user continues to get the same treatment after they sign up for your product that they used to get when they were simply a visitor to your site. In that case, before they sign up, you can use their visitor id for both matching and bucketing, but post log-in you can use their user id for matching and visitor id for bucketing.
        Specified by:
        getTreatment in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatments

        public Map<String,​String> getTreatments​(String key,
                                                      List<String> featureFlagNames,
                                                      EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Returns a map of feature flag name and treatments to show this key for these feature flags. The set of treatments for a feature flag can be configured on the Split user interface.

        This method returns for each feature flag the string 'control' if:

        1. Any of the parameters were null
        2. There was an exception in evaluating the treatment
        3. The SDK does not know of the existence of this feature flag
        4. The feature flag was deleted through the Split user interface.
        'control' is a reserved treatment (you cannot create a treatment with the same name) to highlight these exceptional circumstances.

        The sdk returns for each feature flag the default treatment of this feature flag if:

        1. The feature flag was killed
        2. The key did not match any of the conditions in the feature flag roll-out plan
        The default treatment of a feature flag is set on the Split user interface.

        This method does not throw any exceptions. It also never returns null.

        Specified by:
        getTreatments in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment for each feature flag, or 'control'.
      • getTreatments

        public Map<String,​String> getTreatments​(String key,
                                                      List<String> featureFlagNames,
                                                      Map<String,​Object> attributes,
                                                      EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        This method is useful when you want to determine the treatments to show to a customer (user, account etc.) based on an attribute of that customer instead of their key.

        Examples include showing different treatments to users on trial plan vs. premium plan. Another example is to show different treatments to users created after a certain date.

        Specified by:
        getTreatments in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatments

        public Map<String,​String> getTreatments​(Key key,
                                                      List<String> featureFlagNames,
                                                      Map<String,​Object> attributes,
                                                      EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        To understand why this method is useful, consider the following simple Feature Flag as an example: if user is in segment employees then feature flag 100%:on else if user is in segment all then feature flag 20%:on,80%:off There are two concepts here: matching and bucketing. Matching refers to ‘user is in segment employees’ or ‘user is in segment all’ whereas bucketing refers to ‘100%:on’ or ‘20%:on,80%:off’. By default, the same customer key is used for both matching and bucketing. However, for some advanced use cases, you may want to use different keys. For such cases, use this method. As an example, suppose you want to rollout to percentages of users in specific accounts. You can achieve that by matching via account id, but bucketing by user id. Another example is when you want to ensure that a user continues to get the same treatment after they sign up for your product that they used to get when they were simply a visitor to your site. In that case, before they sign up, you can use their visitor id for both matching and bucketing, but post log-in you can use their user id for matching and visitor id for bucketing.
        Specified by:
        getTreatments in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment of the feature flag, or 'control'.
      • getTreatmentWithConfig

        public SplitResult getTreatmentWithConfig​(String key,
                                                  String featureFlagName,
                                                  EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatment(String, String) but it returns the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        evaluationOptions - additional data for evaluation
        Returns:
        SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentWithConfig

        public SplitResult getTreatmentWithConfig​(Key key,
                                                  String featureFlagName,
                                                  Map<String,​Object> attributes,
                                                  EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatment(Key, String, Map) but it returns the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} will be null.
        Specified by:
        getTreatmentWithConfig in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentWithConfig

        public SplitResult getTreatmentWithConfig​(String key,
                                                  String featureFlagName,
                                                  Map<String,​Object> attributes,
                                                  EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatment(String, String, Map) but it returns the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagName - the name of the feature flag we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfig

        public Map<String,​SplitResult> getTreatmentsWithConfig​(String key,
                                                                     List<String> featureFlagNames,
                                                                     Map<String,​Object> attributes,
                                                                     EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag a SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfig

        public Map<String,​SplitResult> getTreatmentsWithConfig​(String key,
                                                                     List<String> featureFlagNames,
                                                                     EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List) but it returns the configuration associated to the matching treatments if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfig in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        evaluationOptions - additional data for evaluation
        Returns:
        Map containing for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsByFlagSet

        public Map<String,​String> getTreatmentsByFlagSet​(String key,
                                                               String flagSet,
                                                               Map<String,​Object> attributes,
                                                               EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSets

        public Map<String,​String> getTreatmentsByFlagSets​(String key,
                                                                List<String> flagSets,
                                                                EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSets

        public Map<String,​String> getTreatmentsByFlagSets​(String key,
                                                                List<String> flagSets,
                                                                Map<String,​Object> attributes,
                                                                EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsWithConfigByFlagSet

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSet​(String key,
                                                                              String flagSet,
                                                                              EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSet

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSet​(String key,
                                                                              String flagSet,
                                                                              Map<String,​Object> attributes,
                                                                              EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSets

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSets​(String key,
                                                                               List<String> flagSets,
                                                                               EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSets

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSets​(String key,
                                                                               List<String> flagSets,
                                                                               Map<String,​Object> attributes,
                                                                               EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSets in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsByFlagSet

        public Map<String,​String> getTreatmentsByFlagSet​(String key,
                                                               String flagSet,
                                                               EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSet in interface SplitClient
        Parameters:
        key - a unique key of your customer (e.g. user_id, user_email, account_id, etc.) MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsWithConfig

        public Map<String,​SplitResult> getTreatmentsWithConfig​(Key key,
                                                                     List<String> featureFlagNames,
                                                                     Map<String,​Object> attributes,
                                                                     EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as SplitClient.getTreatments(Key, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} will be null.
        Specified by:
        getTreatmentsWithConfig in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST NOT be null.
        featureFlagNames - the names of the feature flags we want to evaluate. MUST NOT be null.
        attributes - of the entity (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag a SplitResult containing the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsByFlagSet

        public Map<String,​String> getTreatmentsByFlagSet​(Key key,
                                                               String flagSet,
                                                               Map<String,​Object> attributes,
                                                               EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSet in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsByFlagSets

        public Map<String,​String> getTreatmentsByFlagSets​(Key key,
                                                                List<String> flagSets,
                                                                Map<String,​Object> attributes,
                                                                EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsByFlagSets in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment, the default treatment of this feature flag, or 'control'.
      • getTreatmentsWithConfigByFlagSet

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSet​(Key key,
                                                                              String flagSet,
                                                                              Map<String,​Object> attributes,
                                                                              EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSet in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSet - the Flag Set name that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • getTreatmentsWithConfigByFlagSets

        public Map<String,​SplitResult> getTreatmentsWithConfigByFlagSets​(Key key,
                                                                               List<String> flagSets,
                                                                               Map<String,​Object> attributes,
                                                                               EvaluationOptions evaluationOptions)
        Description copied from interface: SplitClient
        Same as #getTreatments(String, List, Map) but it returns for each feature flag the configuration associated to the matching treatment if any. Otherwise {@link SplitResult.config()} 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.

        Specified by:
        getTreatmentsWithConfigByFlagSets in interface SplitClient
        Parameters:
        key - the matching and bucketing keys. MUST not be null or empty.
        flagSets - the names of Flag Sets that you want to evaluate. MUST not be null or empty.
        attributes - of the customer (user, account etc.) to use in evaluation. Can be null or empty.
        evaluationOptions - additional data for evaluation
        Returns:
        for each feature flag the evaluated treatment (the default treatment of this feature flag, or 'control') and a configuration associated to this treatment if set.
      • track

        public boolean track​(String key,
                             String trafficType,
                             String eventType)
        Description copied from interface: SplitClient
        Enqueue a new event to be sent to split data collection services Example: client.track(“account”, “Split Software”, “checkout”)
        Specified by:
        track in interface SplitClient
        Parameters:
        key - the identifier of the entity
        trafficType - the type of the event
        eventType - the type of the event
        Returns:
        true if the track was successful, false otherwise
      • track

        public boolean track​(String key,
                             String trafficType,
                             String eventType,
                             double value)
        Description copied from interface: SplitClient
        Enqueue a new event to be sent to split data collection services Example: client.track(“account”, “Split Software”, “checkout”, 200.00)
        Specified by:
        track in interface SplitClient
        Parameters:
        key - the identifier of the entity
        trafficType - the type of the event
        eventType - the type of the event
        value - the value of the event
        Returns:
        true if the track was successful, false otherwise
      • track

        public boolean track​(String key,
                             String trafficType,
                             String eventType,
                             Map<String,​Object> properties)
        Description copied from interface: SplitClient
        Enqueue a new event to be sent to split data collection services Example: client.track(“account”, “Split Software”, “checkout”, Collections.singletonMap("age", 23))
        Specified by:
        track in interface SplitClient
        Parameters:
        key - the identifier of the entity
        trafficType - the type of the event
        eventType - the type of the event
        Returns:
        true if the track was successful, false otherwise
      • track

        public boolean track​(String key,
                             String trafficType,
                             String eventType,
                             double value,
                             Map<String,​Object> properties)
        Description copied from interface: SplitClient
        Enqueue a new event to be sent to split data collection services Example: client.track(“account”, “Split Software”, “checkout”, 123, Collections.singletonMap("age", 23))
        Specified by:
        track in interface SplitClient
        Parameters:
        key - the identifier of the entity
        trafficType - the type of the event
        eventType - the type of the event
        value - the value of the event
        Returns:
        true if the track was successful, false otherwise
      • destroy

        public void destroy()
        Description copied from interface: SplitClient
        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
        Specified by:
        destroy in interface SplitClient