com.launchdarkly.client.Rule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of launchdarkly-client Show documentation
Show all versions of launchdarkly-client Show documentation
Official LaunchDarkly SDK for Java
package com.launchdarkly.client;
import java.util.List;
/**
* Expresses a set of AND-ed matching conditions for a user, along with either the fixed variation or percent rollout
* to serve if the conditions match.
* Invariant: one of the variation or rollout must be non-nil.
*/
class Rule extends VariationOrRollout {
private List clauses;
// We need this so Gson doesn't complain in certain java environments that restrict unsafe allocation
Rule() {
super();
}
Rule(List clauses, Integer variation, Rollout rollout) {
super(variation, rollout);
this.clauses = clauses;
}
boolean matchesUser(FeatureStore store, LDUser user) {
for (Clause clause : clauses) {
if (!clause.matchesUser(store, user)) {
return false;
}
}
return true;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy