Class Filter

java.lang.Object
growthbook.sdk.java.Filter

public class Filter extends Object
Object used for mutual exclusion and filtering users out of experiments based on random hashes.
  • Constructor Details

    • Filter

      public Filter(@Nullable String seed, List<BucketRange> ranges, String attribute, Integer hashVersion)
      Object used for mutual exclusion and filtering users out of experiments based on random hashes.
      Parameters:
      seed - The seed used in the hash
      ranges - Array of ranges that are included
      attribute - The attribute to use (default: "id")
      hashVersion - The hash version to use (default: 2)
  • Method Details

    • toJson

      public String toJson()
      Returns:
      JSON string of the Filter
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static Filter.FilterBuilder builder()
    • getSeed

      public String getSeed()
      The seed used in the hash
    • getRanges

      public List<BucketRange> getRanges()
      Array of ranges that are included
    • getAttribute

      public String getAttribute()
      The attribute to use (default to "id")
    • getHashVersion

      public Integer getHashVersion()
      The hash version to use (default to 2)