/*
 * 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 com.fasterxml.jackson.annotation.JsonPropertyOrder;

/**
 * Marks a field as sortable, properties are filled only when sorting has been applied.
 */
@ApiModel(description = "Marks a field as sortable, properties are filled only when sorting has been applied.")
@JsonPropertyOrder({
  Sort.JSON_PROPERTY_PRIO,
  Sort.JSON_PROPERTY_ORDER,
  Sort.JSON_PROPERTY_PATH_ASC,
  Sort.JSON_PROPERTY_PATH_DESC
})
@JsonTypeName("Sort")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-09-06T11:11:26.226947+02:00[Europe/Berlin]")
public class Sort {
  public static final String JSON_PROPERTY_PRIO = "prio";
  private Integer prio;

  /**
   * The order for this sort (ascending or descending).
   */
  public enum OrderEnum {
    ASC("asc"),
    
    DESC("desc");

    private String value;

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

    @JsonValue
    public String getValue() {
      return value;
    }

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

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

  public static final String JSON_PROPERTY_ORDER = "order";
  private OrderEnum order;

  public static final String JSON_PROPERTY_PATH_ASC = "pathAsc";
  private String pathAsc;

  public static final String JSON_PROPERTY_PATH_DESC = "pathDesc";
  private String pathDesc;


  public Sort prio(Integer prio) {
    
    this.prio = prio;
    return this;
  }

   /**
   * The priority for this sort, important when a multi-field sort is applied.
   * @return prio
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The priority for this sort, important when a multi-field sort is applied.")
  @JsonProperty(JSON_PROPERTY_PRIO)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getPrio() {
    return prio;
  }


  @JsonProperty(JSON_PROPERTY_PRIO)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPrio(Integer prio) {
    this.prio = prio;
  }


  public Sort order(OrderEnum order) {
    
    this.order = order;
    return this;
  }

   /**
   * The order for this sort (ascending or descending).
   * @return order
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The order for this sort (ascending or descending).")
  @JsonProperty(JSON_PROPERTY_ORDER)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public OrderEnum getOrder() {
    return order;
  }


  @JsonProperty(JSON_PROPERTY_ORDER)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setOrder(OrderEnum order) {
    this.order = order;
  }


  public Sort pathAsc(String pathAsc) {
    
    this.pathAsc = pathAsc;
    return this;
  }

   /**
   * the path to sort ascending
   * @return pathAsc
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "the path to sort ascending")
  @JsonProperty(JSON_PROPERTY_PATH_ASC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getPathAsc() {
    return pathAsc;
  }


  @JsonProperty(JSON_PROPERTY_PATH_ASC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPathAsc(String pathAsc) {
    this.pathAsc = pathAsc;
  }


  public Sort pathDesc(String pathDesc) {
    
    this.pathDesc = pathDesc;
    return this;
  }

   /**
   * the path to sort descending
   * @return pathDesc
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "the path to sort descending")
  @JsonProperty(JSON_PROPERTY_PATH_DESC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getPathDesc() {
    return pathDesc;
  }


  @JsonProperty(JSON_PROPERTY_PATH_DESC)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPathDesc(String pathDesc) {
    this.pathDesc = pathDesc;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Sort sort = (Sort) o;
    return Objects.equals(this.prio, sort.prio) &&
        Objects.equals(this.order, sort.order) &&
        Objects.equals(this.pathAsc, sort.pathAsc) &&
        Objects.equals(this.pathDesc, sort.pathDesc);
  }

  @Override
  public int hashCode() {
    return Objects.hash(prio, order, pathAsc, pathDesc);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Sort {\n");
    sb.append("    prio: ").append(toIndentedString(prio)).append("\n");
    sb.append("    order: ").append(toIndentedString(order)).append("\n");
    sb.append("    pathAsc: ").append(toIndentedString(pathAsc)).append("\n");
    sb.append("    pathDesc: ").append(toIndentedString(pathDesc)).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    ");
  }

}

