/*
 * appNG REST API
 * The REST API for appNG
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: matthias.mueller@appng.org
 *
 * 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.appng.openapi.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

/**
 * A single option, used in a filter or an action-field.
 */
@ApiModel(description = "A single option, used in a filter or an action-field.")
@JsonPropertyOrder({
  Option.JSON_PROPERTY_VALUE,
  Option.JSON_PROPERTY_LABEL,
  Option.JSON_PROPERTY_SELECTED,
  Option.JSON_PROPERTY_HITS,
  Option.JSON_PROPERTY_OPTIONS
})
@JsonTypeName("Option")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-09-06T11:11:26.226947+02:00[Europe/Berlin]")
public class Option {
  public static final String JSON_PROPERTY_VALUE = "value";
  private String value;

  public static final String JSON_PROPERTY_LABEL = "label";
  private String label;

  public static final String JSON_PROPERTY_SELECTED = "selected";
  private Boolean selected;

  public static final String JSON_PROPERTY_HITS = "hits";
  private Integer hits;

  public static final String JSON_PROPERTY_OPTIONS = "options";
  private List<Option> options = null;


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

   /**
   * The value for this option.
   * @return value
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The value for this option.")
  @JsonProperty(JSON_PROPERTY_VALUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getValue() {
    return value;
  }


  @JsonProperty(JSON_PROPERTY_VALUE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setValue(String value) {
    this.value = value;
  }


  public Option label(String label) {
    
    this.label = label;
    return this;
  }

   /**
   * The label for this option.
   * @return label
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The label for this option.")
  @JsonProperty(JSON_PROPERTY_LABEL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getLabel() {
    return label;
  }


  @JsonProperty(JSON_PROPERTY_LABEL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setLabel(String label) {
    this.label = label;
  }


  public Option selected(Boolean selected) {
    
    this.selected = selected;
    return this;
  }

   /**
   * Whether or not this option is selected.
   * @return selected
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Whether or not this option is selected.")
  @JsonProperty(JSON_PROPERTY_SELECTED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getSelected() {
    return selected;
  }


  @JsonProperty(JSON_PROPERTY_SELECTED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSelected(Boolean selected) {
    this.selected = selected;
  }


  public Option hits(Integer hits) {
    
    this.hits = hits;
    return this;
  }

   /**
   * Tells how many hits there are for this option.
   * @return hits
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Tells how many hits there are for this option.")
  @JsonProperty(JSON_PROPERTY_HITS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getHits() {
    return hits;
  }


  @JsonProperty(JSON_PROPERTY_HITS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setHits(Integer hits) {
    this.hits = hits;
  }


  public Option options(List<Option> options) {
    
    this.options = options;
    return this;
  }

  public Option addOptionsItem(Option optionsItem) {
    if (this.options == null) {
      this.options = new ArrayList<>();
    }
    this.options.add(optionsItem);
    return this;
  }

   /**
   * An option can act as a group and thus can itself own a list of options.
   * @return options
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "An option can act as a group and thus can itself own a list of options.")
  @JsonProperty(JSON_PROPERTY_OPTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Option> getOptions() {
    return options;
  }


  @JsonProperty(JSON_PROPERTY_OPTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setOptions(List<Option> options) {
    this.options = options;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Option option = (Option) o;
    return Objects.equals(this.value, option.value) &&
        Objects.equals(this.label, option.label) &&
        Objects.equals(this.selected, option.selected) &&
        Objects.equals(this.hits, option.hits) &&
        Objects.equals(this.options, option.options);
  }

  @Override
  public int hashCode() {
    return Objects.hash(value, label, selected, hits, options);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Option {\n");
    sb.append("    value: ").append(toIndentedString(value)).append("\n");
    sb.append("    label: ").append(toIndentedString(label)).append("\n");
    sb.append("    selected: ").append(toIndentedString(selected)).append("\n");
    sb.append("    hits: ").append(toIndentedString(hits)).append("\n");
    sb.append("    options: ").append(toIndentedString(options)).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    ");
  }

}

