All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.harness.cf.model.GroupServingRule Maven / Gradle / Ivy

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.Clause;
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;

/**
 * The rule used to determine what variation to serve to a target
 */
@ApiModel(description = "The rule used to determine what variation to serve to a target")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T14:30:44.890314Z[GMT]")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GroupServingRule implements Serializable {
  private static final long serialVersionUID = 1L;

  public static final String SERIALIZED_NAME_RULE_ID = "ruleId";
  @SerializedName(SERIALIZED_NAME_RULE_ID)
  private String ruleId;

  public static final String SERIALIZED_NAME_PRIORITY = "priority";
  @SerializedName(SERIALIZED_NAME_PRIORITY)
  private Integer priority;

  public static final String SERIALIZED_NAME_CLAUSES = "clauses";
  @SerializedName(SERIALIZED_NAME_CLAUSES)
  private List clauses = new ArrayList<>();


  public GroupServingRule ruleId(String ruleId) {
    
    this.ruleId = ruleId;
    return this;
  }

   /**
   * The unique identifier for this rule
   * @return ruleId
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The unique identifier for this rule")

  public String getRuleId() {
    return ruleId;
  }


  public void setRuleId(String ruleId) {
    this.ruleId = ruleId;
  }


  public GroupServingRule priority(Integer priority) {
    
    this.priority = priority;
    return this;
  }

   /**
   * The rules priority relative to other rules.  The rules are evaluated in order with 1 being the highest
   * @return priority
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "1", required = true, value = "The rules priority relative to other rules.  The rules are evaluated in order with 1 being the highest")

  public Integer getPriority() {
    return priority;
  }


  public void setPriority(Integer priority) {
    this.priority = priority;
  }


  public GroupServingRule clauses(List clauses) {
    
    this.clauses = clauses;
    return this;
  }

   /**
   * A list of clauses to use in the rule
   * @return clauses
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "A list of clauses to use in the rule")

  public List getClauses() {
    return clauses;
  }


  public void setClauses(List clauses) {
    this.clauses = clauses;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GroupServingRule groupServingRule = (GroupServingRule) o;
    return Objects.equals(this.ruleId, groupServingRule.ruleId) &&
        Objects.equals(this.priority, groupServingRule.priority) &&
        Objects.equals(this.clauses, groupServingRule.clauses);
  }

  @Override
  public int hashCode() {
    return Objects.hash(ruleId, priority, clauses);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class GroupServingRule {\n");
    sb.append("    ruleId: ").append(toIndentedString(ruleId)).append("\n");
    sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
    sb.append("    clauses: ").append(toIndentedString(clauses)).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