/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.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 org.openapitools.client.model.WFTransition;

/**
 * WFDecisionRule
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class WFDecisionRule {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Long id;

  public static final String SERIALIZED_NAME_VERSION = "version";
  @SerializedName(SERIALIZED_NAME_VERSION)
  private Integer version;

  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  public static final String SERIALIZED_NAME_VALUE = "value";
  @SerializedName(SERIALIZED_NAME_VALUE)
  private String value;

  /**
   * Gets or Sets type
   */
  @JsonAdapter(TypeEnum.Adapter.class)
  public enum TypeEnum {
    STRING("STRING"),
    
    DATE("DATE"),
    
    NUMBER("NUMBER"),
    
    RANGE_STRING("RANGE_STRING"),
    
    RANGE_DATE("RANGE_DATE"),
    
    RANGE_NUMBER("RANGE_NUMBER");

    private String value;

    TypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TypeEnum fromValue(String value) {
      for (TypeEnum b : TypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<TypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TypeEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return TypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_TYPE = "type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private TypeEnum type;

  public static final String SERIALIZED_NAME_CONDITION_EL = "conditionEl";
  @SerializedName(SERIALIZED_NAME_CONDITION_EL)
  private String conditionEl;

  public static final String SERIALIZED_NAME_MODEL = "model";
  @SerializedName(SERIALIZED_NAME_MODEL)
  private Boolean model;

  public static final String SERIALIZED_NAME_WF_TRANSITIONS = "wfTransitions";
  @SerializedName(SERIALIZED_NAME_WF_TRANSITIONS)
  private List<WFTransition> wfTransitions = null;

  public static final String SERIALIZED_NAME_TRANSIENT = "transient";
  @SerializedName(SERIALIZED_NAME_TRANSIENT)
  private Boolean _transient;


  public WFDecisionRule id(Long id) {
    
    this.id = id;
    return this;
  }

   /**
   * Get id
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Long getId() {
    return id;
  }



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


  public WFDecisionRule version(Integer version) {
    
    this.version = version;
    return this;
  }

   /**
   * Get version
   * @return version
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Integer getVersion() {
    return version;
  }



  public void setVersion(Integer version) {
    this.version = version;
  }


  public WFDecisionRule name(String name) {
    
    this.name = name;
    return this;
  }

   /**
   * Get name
   * @return name
  **/
  @ApiModelProperty(required = true, value = "")

  public String getName() {
    return name;
  }



  public void setName(String name) {
    this.name = name;
  }


  public WFDecisionRule value(String value) {
    
    this.value = value;
    return this;
  }

   /**
   * Get value
   * @return value
  **/
  @ApiModelProperty(required = true, value = "")

  public String getValue() {
    return value;
  }



  public void setValue(String value) {
    this.value = value;
  }


  public WFDecisionRule type(TypeEnum type) {
    
    this.type = type;
    return this;
  }

   /**
   * Get type
   * @return type
  **/
  @ApiModelProperty(required = true, value = "")

  public TypeEnum getType() {
    return type;
  }



  public void setType(TypeEnum type) {
    this.type = type;
  }


  public WFDecisionRule conditionEl(String conditionEl) {
    
    this.conditionEl = conditionEl;
    return this;
  }

   /**
   * Get conditionEl
   * @return conditionEl
  **/
  @ApiModelProperty(required = true, value = "")

  public String getConditionEl() {
    return conditionEl;
  }



  public void setConditionEl(String conditionEl) {
    this.conditionEl = conditionEl;
  }


  public WFDecisionRule model(Boolean model) {
    
    this.model = model;
    return this;
  }

   /**
   * Get model
   * @return model
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getModel() {
    return model;
  }



  public void setModel(Boolean model) {
    this.model = model;
  }


  public WFDecisionRule wfTransitions(List<WFTransition> wfTransitions) {
    
    this.wfTransitions = wfTransitions;
    return this;
  }

  public WFDecisionRule addWfTransitionsItem(WFTransition wfTransitionsItem) {
    if (this.wfTransitions == null) {
      this.wfTransitions = new ArrayList<WFTransition>();
    }
    this.wfTransitions.add(wfTransitionsItem);
    return this;
  }

   /**
   * Get wfTransitions
   * @return wfTransitions
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public List<WFTransition> getWfTransitions() {
    return wfTransitions;
  }



  public void setWfTransitions(List<WFTransition> wfTransitions) {
    this.wfTransitions = wfTransitions;
  }


  public WFDecisionRule _transient(Boolean _transient) {
    
    this._transient = _transient;
    return this;
  }

   /**
   * Get _transient
   * @return _transient
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Boolean getTransient() {
    return _transient;
  }



  public void setTransient(Boolean _transient) {
    this._transient = _transient;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WFDecisionRule wfDecisionRule = (WFDecisionRule) o;
    return Objects.equals(this.id, wfDecisionRule.id) &&
        Objects.equals(this.version, wfDecisionRule.version) &&
        Objects.equals(this.name, wfDecisionRule.name) &&
        Objects.equals(this.value, wfDecisionRule.value) &&
        Objects.equals(this.type, wfDecisionRule.type) &&
        Objects.equals(this.conditionEl, wfDecisionRule.conditionEl) &&
        Objects.equals(this.model, wfDecisionRule.model) &&
        Objects.equals(this.wfTransitions, wfDecisionRule.wfTransitions) &&
        Objects.equals(this._transient, wfDecisionRule._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, name, value, type, conditionEl, model, wfTransitions, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class WFDecisionRule {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    value: ").append(toIndentedString(value)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    conditionEl: ").append(toIndentedString(conditionEl)).append("\n");
    sb.append("    model: ").append(toIndentedString(model)).append("\n");
    sb.append("    wfTransitions: ").append(toIndentedString(wfTransitions)).append("\n");
    sb.append("    _transient: ").append(toIndentedString(_transient)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

