com.configcat.TargetingRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of configcat-java-client Show documentation
Show all versions of configcat-java-client Show documentation
Java SDK for ConfigCat, a feature flag, feature toggle, and configuration management service. That lets you launch new features and change your software configuration remotely without actually (re)deploying code. ConfigCat even helps you do controlled roll-outs like canary releases and blue-green deployments.
The newest version!
package com.configcat;
import com.google.gson.annotations.SerializedName;
/**
* Describes a targeting rule.
*/
public class TargetingRule {
@SerializedName(value = "c")
private Condition[] conditions;
@SerializedName(value = "p")
private PercentageOption[] percentageOptions;
@SerializedName(value = "s")
private SimpleValue simpleValue;
/**
* The list of conditions that are combined with the AND logical operator.
* Items can be one of the following types: {@link UserCondition}, {@link SegmentCondition} or {@link PrerequisiteFlagCondition}.
*/
public Condition[] getConditions() {
return conditions != null ? conditions : new Condition[]{};
}
/**
* The list of percentage options associated with the targeting rule or {@code null} if the targeting rule has a simple value THEN part.
*/
public PercentageOption[] getPercentageOptions() {
return percentageOptions;
}
/**
* The simple value associated with the targeting rule or {@code null} if the targeting rule has percentage options THEN part.
*/
public SimpleValue getSimpleValue() {
return simpleValue;
}
}
class SimpleValue {
@SerializedName(value = "v")
private SettingValue value;
@SerializedName(value = "i")
private String variationId;
public SettingValue getValue() {
return value;
}
public String getVariationId() {
return variationId;
}
}