io.featurehub.strategies.matchers.MatcherRegistry 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.FeatureRolloutStrategyAttribute;
public class MatcherRegistry implements MatcherRepository {
@Override
public StrategyMatcher findMatcher(FeatureRolloutStrategyAttribute attr) {
switch (attr.getType()) {
case STRING:
return new StringArrayMatcher();
case SEMANTIC_VERSION:
return new SemanticVersionArrayMatcher();
case NUMBER:
return new NumberArrayMatcher();
case DATE:
return new DateArrayMatcher();
case DATETIME:
return new DateTimeArrayMatcher();
case BOOLEAN: // can't have arrays, that would be silly
return new BooleanArrayMatcher();
case IP_ADDRESS:
return new IpAddressArrayMatcher();
}
return new FallthroughMatcher();
}
static class FallthroughMatcher implements StrategyMatcher {
@Override
public boolean match(String suppliedValue, FeatureRolloutStrategyAttribute attr) {
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy