package org.wfc.omada.api.sitesetting.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * RuleEntity
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:32:19.054+08:00[Asia/Shanghai]")

public class RuleEntity   {
  @JsonProperty("ruleName")
  private String ruleName;

  @JsonProperty("ruleId")
  private Integer ruleId;

  @JsonProperty("schedule")
  private String schedule;

  @JsonProperty("qos")
  private Boolean qos;

  @JsonProperty("qosClass")
  private Integer qosClass;

  @JsonProperty("applications")
  @Valid
  private List<ApplicationEntity> applications = null;

  public RuleEntity ruleName(String ruleName) {
    this.ruleName = ruleName;
    return this;
  }

  /**
   * Rule name
   * @return ruleName
  */
  @ApiModelProperty(value = "Rule name")


  public String getRuleName() {
    return ruleName;
  }

  public void setRuleName(String ruleName) {
    this.ruleName = ruleName;
  }

  public RuleEntity ruleId(Integer ruleId) {
    this.ruleId = ruleId;
    return this;
  }

  /**
   * Rule ID
   * @return ruleId
  */
  @ApiModelProperty(value = "Rule ID")


  public Integer getRuleId() {
    return ruleId;
  }

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

  public RuleEntity schedule(String schedule) {
    this.schedule = schedule;
    return this;
  }

  /**
   * Schedule profile ID
   * @return schedule
  */
  @ApiModelProperty(value = "Schedule profile ID")


  public String getSchedule() {
    return schedule;
  }

  public void setSchedule(String schedule) {
    this.schedule = schedule;
  }

  public RuleEntity qos(Boolean qos) {
    this.qos = qos;
    return this;
  }

  /**
   * Enable qos. true:enable / false:disable
   * @return qos
  */
  @ApiModelProperty(value = "Enable qos. true:enable / false:disable")


  public Boolean getQos() {
    return qos;
  }

  public void setQos(Boolean qos) {
    this.qos = qos;
  }

  public RuleEntity qosClass(Integer qosClass) {
    this.qosClass = qosClass;
    return this;
  }

  /**
   * Qos class category
   * @return qosClass
  */
  @ApiModelProperty(value = "Qos class category")


  public Integer getQosClass() {
    return qosClass;
  }

  public void setQosClass(Integer qosClass) {
    this.qosClass = qosClass;
  }

  public RuleEntity applications(List<ApplicationEntity> applications) {
    this.applications = applications;
    return this;
  }

  public RuleEntity addApplicationsItem(ApplicationEntity applicationsItem) {
    if (this.applications == null) {
      this.applications = new ArrayList<>();
    }
    this.applications.add(applicationsItem);
    return this;
  }

  /**
   * Application list
   * @return applications
  */
  @ApiModelProperty(value = "Application list")

  @Valid

  public List<ApplicationEntity> getApplications() {
    return applications;
  }

  public void setApplications(List<ApplicationEntity> applications) {
    this.applications = applications;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RuleEntity ruleEntity = (RuleEntity) o;
    return Objects.equals(this.ruleName, ruleEntity.ruleName) &&
        Objects.equals(this.ruleId, ruleEntity.ruleId) &&
        Objects.equals(this.schedule, ruleEntity.schedule) &&
        Objects.equals(this.qos, ruleEntity.qos) &&
        Objects.equals(this.qosClass, ruleEntity.qosClass) &&
        Objects.equals(this.applications, ruleEntity.applications);
  }

  @Override
  public int hashCode() {
    return Objects.hash(ruleName, ruleId, schedule, qos, qosClass, applications);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RuleEntity {\n");
    
    sb.append("    ruleName: ").append(toIndentedString(ruleName)).append("\n");
    sb.append("    ruleId: ").append(toIndentedString(ruleId)).append("\n");
    sb.append("    schedule: ").append(toIndentedString(schedule)).append("\n");
    sb.append("    qos: ").append(toIndentedString(qos)).append("\n");
    sb.append("    qosClass: ").append(toIndentedString(qosClass)).append("\n");
    sb.append("    applications: ").append(toIndentedString(applications)).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    ");
  }
}

