io.harness.cf.model.FeatureConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ff-java-server-sdk Show documentation
Show all versions of ff-java-server-sdk Show documentation
Harness Feature Flag Java Server SDK
The newest version!
/*
* Harness feature flag service client apis
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.harness.cf.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.harness.cf.model.FeatureState;
import io.harness.cf.model.Prerequisite;
import io.harness.cf.model.Serve;
import io.harness.cf.model.ServingRule;
import io.harness.cf.model.Variation;
import io.harness.cf.model.VariationMap;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
/**
* FeatureConfig
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T14:30:44.890314Z[GMT]")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FeatureConfig implements Serializable {
private static final long serialVersionUID = 1L;
public static final String SERIALIZED_NAME_PROJECT = "project";
@SerializedName(SERIALIZED_NAME_PROJECT)
private String project;
public static final String SERIALIZED_NAME_ENVIRONMENT = "environment";
@SerializedName(SERIALIZED_NAME_ENVIRONMENT)
private String environment;
public static final String SERIALIZED_NAME_FEATURE = "feature";
@SerializedName(SERIALIZED_NAME_FEATURE)
private String feature;
public static final String SERIALIZED_NAME_STATE = "state";
@SerializedName(SERIALIZED_NAME_STATE)
private FeatureState state;
/**
* Gets or Sets kind
*/
@JsonAdapter(KindEnum.Adapter.class)
public enum KindEnum {
BOOLEAN("boolean"),
INT("int"),
STRING("string"),
JSON("json");
private String value;
KindEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static KindEnum fromValue(String value) {
for (KindEnum b : KindEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public KindEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return KindEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_KIND = "kind";
@SerializedName(SERIALIZED_NAME_KIND)
private KindEnum kind;
public static final String SERIALIZED_NAME_VARIATIONS = "variations";
@SerializedName(SERIALIZED_NAME_VARIATIONS)
private List variations = new ArrayList<>();
public static final String SERIALIZED_NAME_RULES = "rules";
@SerializedName(SERIALIZED_NAME_RULES)
private List rules = null;
public static final String SERIALIZED_NAME_DEFAULT_SERVE = "defaultServe";
@SerializedName(SERIALIZED_NAME_DEFAULT_SERVE)
private Serve defaultServe;
public static final String SERIALIZED_NAME_OFF_VARIATION = "offVariation";
@SerializedName(SERIALIZED_NAME_OFF_VARIATION)
private String offVariation;
public static final String SERIALIZED_NAME_PREREQUISITES = "prerequisites";
@SerializedName(SERIALIZED_NAME_PREREQUISITES)
private List prerequisites = null;
public static final String SERIALIZED_NAME_VARIATION_TO_TARGET_MAP = "variationToTargetMap";
@SerializedName(SERIALIZED_NAME_VARIATION_TO_TARGET_MAP)
private List variationToTargetMap = null;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private Long version;
public FeatureConfig project(String project) {
this.project = project;
return this;
}
/**
* Get project
* @return project
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getProject() {
return project;
}
public void setProject(String project) {
this.project = project;
}
public FeatureConfig environment(String environment) {
this.environment = environment;
return this;
}
/**
* Get environment
* @return environment
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEnvironment() {
return environment;
}
public void setEnvironment(String environment) {
this.environment = environment;
}
public FeatureConfig feature(String feature) {
this.feature = feature;
return this;
}
/**
* Get feature
* @return feature
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getFeature() {
return feature;
}
public void setFeature(String feature) {
this.feature = feature;
}
public FeatureConfig state(FeatureState state) {
this.state = state;
return this;
}
/**
* Get state
* @return state
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public FeatureState getState() {
return state;
}
public void setState(FeatureState state) {
this.state = state;
}
public FeatureConfig kind(KindEnum kind) {
this.kind = kind;
return this;
}
/**
* Get kind
* @return kind
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public KindEnum getKind() {
return kind;
}
public void setKind(KindEnum kind) {
this.kind = kind;
}
public FeatureConfig variations(List variations) {
this.variations = variations;
return this;
}
/**
* Get variations
* @return variations
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List getVariations() {
return variations;
}
public void setVariations(List variations) {
this.variations = variations;
}
public FeatureConfig rules(List rules) {
this.rules = rules;
return this;
}
/**
* Get rules
* @return rules
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List getRules() {
return rules;
}
public void setRules(List rules) {
this.rules = rules;
}
public FeatureConfig defaultServe(Serve defaultServe) {
this.defaultServe = defaultServe;
return this;
}
/**
* Get defaultServe
* @return defaultServe
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Serve getDefaultServe() {
return defaultServe;
}
public void setDefaultServe(Serve defaultServe) {
this.defaultServe = defaultServe;
}
public FeatureConfig offVariation(String offVariation) {
this.offVariation = offVariation;
return this;
}
/**
* Get offVariation
* @return offVariation
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getOffVariation() {
return offVariation;
}
public void setOffVariation(String offVariation) {
this.offVariation = offVariation;
}
public FeatureConfig prerequisites(List prerequisites) {
this.prerequisites = prerequisites;
return this;
}
/**
* Get prerequisites
* @return prerequisites
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List getPrerequisites() {
return prerequisites;
}
public void setPrerequisites(List prerequisites) {
this.prerequisites = prerequisites;
}
public FeatureConfig variationToTargetMap(List variationToTargetMap) {
this.variationToTargetMap = variationToTargetMap;
return this;
}
/**
* Get variationToTargetMap
* @return variationToTargetMap
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List getVariationToTargetMap() {
return variationToTargetMap;
}
public void setVariationToTargetMap(List variationToTargetMap) {
this.variationToTargetMap = variationToTargetMap;
}
public FeatureConfig version(Long version) {
this.version = version;
return this;
}
/**
* Get version
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FeatureConfig featureConfig = (FeatureConfig) o;
return Objects.equals(this.project, featureConfig.project) &&
Objects.equals(this.environment, featureConfig.environment) &&
Objects.equals(this.feature, featureConfig.feature) &&
Objects.equals(this.state, featureConfig.state) &&
Objects.equals(this.kind, featureConfig.kind) &&
Objects.equals(this.variations, featureConfig.variations) &&
Objects.equals(this.rules, featureConfig.rules) &&
Objects.equals(this.defaultServe, featureConfig.defaultServe) &&
Objects.equals(this.offVariation, featureConfig.offVariation) &&
Objects.equals(this.prerequisites, featureConfig.prerequisites) &&
Objects.equals(this.variationToTargetMap, featureConfig.variationToTargetMap) &&
Objects.equals(this.version, featureConfig.version);
}
@Override
public int hashCode() {
return Objects.hash(project, environment, feature, state, kind, variations, rules, defaultServe, offVariation, prerequisites, variationToTargetMap, version);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FeatureConfig {\n");
sb.append(" project: ").append(toIndentedString(project)).append("\n");
sb.append(" environment: ").append(toIndentedString(environment)).append("\n");
sb.append(" feature: ").append(toIndentedString(feature)).append("\n");
sb.append(" state: ").append(toIndentedString(state)).append("\n");
sb.append(" kind: ").append(toIndentedString(kind)).append("\n");
sb.append(" variations: ").append(toIndentedString(variations)).append("\n");
sb.append(" rules: ").append(toIndentedString(rules)).append("\n");
sb.append(" defaultServe: ").append(toIndentedString(defaultServe)).append("\n");
sb.append(" offVariation: ").append(toIndentedString(offVariation)).append("\n");
sb.append(" prerequisites: ").append(toIndentedString(prerequisites)).append("\n");
sb.append(" variationToTargetMap: ").append(toIndentedString(variationToTargetMap)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy