Package 

Object AudienceRuleSet.Companion

    • Method Summary

      Modifier and Type Method Description
      final AudienceRuleSet fromMap(Map<String, Object> data)
      final AudienceRuleSet fromAny(Object rules) Parse an audience_rules payload in EITHER shape the console/backend emits:
      • { priority, conditions | rules: [...], match_mode } — a rule set, or

      • [ {trait, operator, value}, ... ] — a bare rule list (AND across rules).

      WHY: consumers that only cast to Map read the list shape as "no rules", which for a paywall means "matches everybody" at priority 0 — targeting silently disabled.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fromAny

         final AudienceRuleSet fromAny(Object rules)

        Parse an audience_rules payload in EITHER shape the console/backend emits:

        • { priority, conditions | rules: [...], match_mode } — a rule set, or

        • [ {trait, operator, value}, ... ] — a bare rule list (AND across rules).

        WHY: consumers that only cast to Map read the list shape as "no rules", which for a paywall means "matches everybody" at priority 0 — targeting silently disabled. Returns null only when there is genuinely nothing to evaluate.