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;

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

public class FilterEntity   {
  @JsonProperty("filterName")
  private String filterName;

  @JsonProperty("filterId")
  private Integer filterId;

  @JsonProperty("description")
  private String description;

  @JsonProperty("rules")
  @Valid
  private List<RuleEntity> rules = null;

  public FilterEntity filterName(String filterName) {
    this.filterName = filterName;
    return this;
  }

  /**
   * Filter name
   * @return filterName
  */
  @ApiModelProperty(value = "Filter name")


  public String getFilterName() {
    return filterName;
  }

  public void setFilterName(String filterName) {
    this.filterName = filterName;
  }

  public FilterEntity filterId(Integer filterId) {
    this.filterId = filterId;
    return this;
  }

  /**
   * Filter ID
   * @return filterId
  */
  @ApiModelProperty(value = "Filter ID")


  public Integer getFilterId() {
    return filterId;
  }

  public void setFilterId(Integer filterId) {
    this.filterId = filterId;
  }

  public FilterEntity description(String description) {
    this.description = description;
    return this;
  }

  /**
   * Description of filter
   * @return description
  */
  @ApiModelProperty(value = "Description of filter")


  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public FilterEntity rules(List<RuleEntity> rules) {
    this.rules = rules;
    return this;
  }

  public FilterEntity addRulesItem(RuleEntity rulesItem) {
    if (this.rules == null) {
      this.rules = new ArrayList<>();
    }
    this.rules.add(rulesItem);
    return this;
  }

  /**
   * Rule list
   * @return rules
  */
  @ApiModelProperty(value = "Rule list")

  @Valid

  public List<RuleEntity> getRules() {
    return rules;
  }

  public void setRules(List<RuleEntity> rules) {
    this.rules = rules;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    FilterEntity filterEntity = (FilterEntity) o;
    return Objects.equals(this.filterName, filterEntity.filterName) &&
        Objects.equals(this.filterId, filterEntity.filterId) &&
        Objects.equals(this.description, filterEntity.description) &&
        Objects.equals(this.rules, filterEntity.rules);
  }

  @Override
  public int hashCode() {
    return Objects.hash(filterName, filterId, description, rules);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class FilterEntity {\n");
    
    sb.append("    filterName: ").append(toIndentedString(filterName)).append("\n");
    sb.append("    filterId: ").append(toIndentedString(filterId)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    rules: ").append(toIndentedString(rules)).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    ");
  }
}

