io.featurehub.strategies.matchers.BooleanArrayMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client-core Show documentation
Show all versions of java-client-core Show documentation
Shared core of featurehub client.
package io.featurehub.strategies.matchers;
import io.featurehub.sse.model.RolloutStrategyAttributeConditional;
import io.featurehub.sse.model.FeatureRolloutStrategyAttribute;
public class BooleanArrayMatcher implements StrategyMatcher {
@Override
public boolean match(String suppliedValue, FeatureRolloutStrategyAttribute attr) {
boolean val = "true".equals(suppliedValue);
if (attr.getConditional() == RolloutStrategyAttributeConditional.EQUALS) {
return val == (Boolean)attr.getValues().get(0);
}
if (attr.getConditional() == RolloutStrategyAttributeConditional.NOT_EQUALS) {
return val == !(Boolean)attr.getValues().get(0);
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy