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

io.harness.cf.model.Clause 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.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;

/**
 * A clause describes what conditions are used to evaluate a flag
 */
@ApiModel(description = "A clause describes what conditions are used to evaluate a flag")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T11:21:47.748293Z[GMT]")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Clause implements Serializable {
  private static final long serialVersionUID = 1L;

  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private String id;

  public static final String SERIALIZED_NAME_ATTRIBUTE = "attribute";
  @SerializedName(SERIALIZED_NAME_ATTRIBUTE)
  private String attribute;

  public static final String SERIALIZED_NAME_OP = "op";
  @SerializedName(SERIALIZED_NAME_OP)
  private String op;

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

  public static final String SERIALIZED_NAME_NEGATE = "negate";
  @SerializedName(SERIALIZED_NAME_NEGATE)
  private Boolean negate;


  public Clause id(String id) {
    
    this.id = id;
    return this;
  }

   /**
   * The unique ID for the clause
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "32434243", value = "The unique ID for the clause")

  public String getId() {
    return id;
  }


  public void setId(String id) {
    this.id = id;
  }


  public Clause attribute(String attribute) {
    
    this.attribute = attribute;
    return this;
  }

   /**
   * The attribute to use in the clause.  This can be any target attribute
   * @return attribute
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "identifier", required = true, value = "The attribute to use in the clause.  This can be any target attribute")

  public String getAttribute() {
    return attribute;
  }


  public void setAttribute(String attribute) {
    this.attribute = attribute;
  }


  public Clause op(String op) {
    
    this.op = op;
    return this;
  }

   /**
   * The type of operation such as equals, starts_with, contains
   * @return op
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "starts_with", required = true, value = "The type of operation such as equals, starts_with, contains")

  public String getOp() {
    return op;
  }


  public void setOp(String op) {
    this.op = op;
  }


  public Clause values(List values) {
    
    this.values = values;
    return this;
  }

   /**
   * The values that are compared against the operator
   * @return values
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The values that are compared against the operator")

  public List getValues() {
    return values;
  }


  public void setValues(List values) {
    this.values = values;
  }


  public Clause negate(Boolean negate) {
    
    this.negate = negate;
    return this;
  }

   /**
   * Is the operation negated?
   * @return negate
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(example = "false", required = true, value = "Is the operation negated?")

  public Boolean getNegate() {
    return negate;
  }


  public void setNegate(Boolean negate) {
    this.negate = negate;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Clause clause = (Clause) o;
    return Objects.equals(this.id, clause.id) &&
        Objects.equals(this.attribute, clause.attribute) &&
        Objects.equals(this.op, clause.op) &&
        Objects.equals(this.values, clause.values) &&
        Objects.equals(this.negate, clause.negate);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, attribute, op, values, negate);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Clause {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    attribute: ").append(toIndentedString(attribute)).append("\n");
    sb.append("    op: ").append(toIndentedString(op)).append("\n");
    sb.append("    values: ").append(toIndentedString(values)).append("\n");
    sb.append("    negate: ").append(toIndentedString(negate)).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