-
public class AudienceRuleSet.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static AudienceRuleSet.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final AudienceRuleSetfromMap(Map<String, Object> data)final AudienceRuleSetfromAny(Object rules)Parse an audience_rulespayload 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).
Mapread the list shape as "no rules", which for a paywall means "matches everybody" at priority 0 — targeting silently disabled.-
-
Method Detail
-
fromMap
final AudienceRuleSet fromMap(Map<String, Object> data)
-
fromAny
final AudienceRuleSet fromAny(Object rules)
Parse an
audience_rulespayload 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
Mapread the list shape as "no rules", which for a paywall means "matches everybody" at priority 0 — targeting silently disabled. Returnsnullonly when there is genuinely nothing to evaluate.
-
-
-