/*
 * 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 org.appng.openapi.model.PageSize;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

/**
 * A page that contains paging information an a list of elements.
 */
@ApiModel(description = "A page that contains paging information an a list of elements.")
@JsonPropertyOrder({
  Page.JSON_PROPERTY_FIRST,
  Page.JSON_PROPERTY_PREVIOUS,
  Page.JSON_PROPERTY_NEXT,
  Page.JSON_PROPERTY_LAST,
  Page.JSON_PROPERTY_NUMBER,
  Page.JSON_PROPERTY_SIZE,
  Page.JSON_PROPERTY_TOTAL_PAGES,
  Page.JSON_PROPERTY_TOTAL_ITEMS,
  Page.JSON_PROPERTY_IS_FIRST,
  Page.JSON_PROPERTY_IS_LAST,
  Page.JSON_PROPERTY_PAGE_SIZES
})
@JsonTypeName("Page")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-09-06T11:11:26.226947+02:00[Europe/Berlin]")
public class Page {
  public static final String JSON_PROPERTY_FIRST = "_first";
  private String first;

  public static final String JSON_PROPERTY_PREVIOUS = "_previous";
  private String previous;

  public static final String JSON_PROPERTY_NEXT = "_next";
  private String next;

  public static final String JSON_PROPERTY_LAST = "_last";
  private String last;

  public static final String JSON_PROPERTY_NUMBER = "number";
  private Integer number;

  public static final String JSON_PROPERTY_SIZE = "size";
  private Integer size;

  public static final String JSON_PROPERTY_TOTAL_PAGES = "totalPages";
  private Integer totalPages;

  public static final String JSON_PROPERTY_TOTAL_ITEMS = "totalItems";
  private Integer totalItems;

  public static final String JSON_PROPERTY_IS_FIRST = "isFirst";
  private Boolean isFirst;

  public static final String JSON_PROPERTY_IS_LAST = "isLast";
  private Boolean isLast;

  public static final String JSON_PROPERTY_PAGE_SIZES = "pageSizes";
  private List<PageSize> pageSizes = null;


  public Page first(String first) {
    
    this.first = first;
    return this;
  }

   /**
   * path to the first page
   * @return first
  **/
  @ApiModelProperty(required = true, value = "path to the first page")
  @JsonProperty(JSON_PROPERTY_FIRST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getFirst() {
    return first;
  }


  @JsonProperty(JSON_PROPERTY_FIRST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setFirst(String first) {
    this.first = first;
  }


  public Page previous(String previous) {
    
    this.previous = previous;
    return this;
  }

   /**
   * path to the previous page
   * @return previous
  **/
  @ApiModelProperty(required = true, value = "path to the previous page")
  @JsonProperty(JSON_PROPERTY_PREVIOUS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getPrevious() {
    return previous;
  }


  @JsonProperty(JSON_PROPERTY_PREVIOUS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setPrevious(String previous) {
    this.previous = previous;
  }


  public Page next(String next) {
    
    this.next = next;
    return this;
  }

   /**
   * path to the next page
   * @return next
  **/
  @ApiModelProperty(required = true, value = "path to the next page")
  @JsonProperty(JSON_PROPERTY_NEXT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getNext() {
    return next;
  }


  @JsonProperty(JSON_PROPERTY_NEXT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setNext(String next) {
    this.next = next;
  }


  public Page last(String last) {
    
    this.last = last;
    return this;
  }

   /**
   * path to the last page
   * @return last
  **/
  @ApiModelProperty(required = true, value = "path to the last page")
  @JsonProperty(JSON_PROPERTY_LAST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getLast() {
    return last;
  }


  @JsonProperty(JSON_PROPERTY_LAST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setLast(String last) {
    this.last = last;
  }


  public Page number(Integer number) {
    
    this.number = number;
    return this;
  }

   /**
   * The 0-based number of the current page.
   * @return number
  **/
  @ApiModelProperty(required = true, value = "The 0-based number of the current page.")
  @JsonProperty(JSON_PROPERTY_NUMBER)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getNumber() {
    return number;
  }


  @JsonProperty(JSON_PROPERTY_NUMBER)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setNumber(Integer number) {
    this.number = number;
  }


  public Page size(Integer size) {
    
    this.size = size;
    return this;
  }

   /**
   * The number of items per page.
   * @return size
  **/
  @ApiModelProperty(required = true, value = "The number of items per page.")
  @JsonProperty(JSON_PROPERTY_SIZE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getSize() {
    return size;
  }


  @JsonProperty(JSON_PROPERTY_SIZE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSize(Integer size) {
    this.size = size;
  }


  public Page totalPages(Integer totalPages) {
    
    this.totalPages = totalPages;
    return this;
  }

   /**
   * The number of total pages.
   * @return totalPages
  **/
  @ApiModelProperty(required = true, value = "The number of total pages.")
  @JsonProperty(JSON_PROPERTY_TOTAL_PAGES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getTotalPages() {
    return totalPages;
  }


  @JsonProperty(JSON_PROPERTY_TOTAL_PAGES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setTotalPages(Integer totalPages) {
    this.totalPages = totalPages;
  }


  public Page totalItems(Integer totalItems) {
    
    this.totalItems = totalItems;
    return this;
  }

   /**
   * The total number of items.
   * @return totalItems
  **/
  @ApiModelProperty(required = true, value = "The total number of items.")
  @JsonProperty(JSON_PROPERTY_TOTAL_ITEMS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getTotalItems() {
    return totalItems;
  }


  @JsonProperty(JSON_PROPERTY_TOTAL_ITEMS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setTotalItems(Integer totalItems) {
    this.totalItems = totalItems;
  }


  public Page isFirst(Boolean isFirst) {
    
    this.isFirst = isFirst;
    return this;
  }

   /**
   * If this is the first page.
   * @return isFirst
  **/
  @ApiModelProperty(required = true, value = "If this is the first page.")
  @JsonProperty(JSON_PROPERTY_IS_FIRST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getIsFirst() {
    return isFirst;
  }


  @JsonProperty(JSON_PROPERTY_IS_FIRST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setIsFirst(Boolean isFirst) {
    this.isFirst = isFirst;
  }


  public Page isLast(Boolean isLast) {
    
    this.isLast = isLast;
    return this;
  }

   /**
   * If this is the last page.
   * @return isLast
  **/
  @ApiModelProperty(required = true, value = "If this is the last page.")
  @JsonProperty(JSON_PROPERTY_IS_LAST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getIsLast() {
    return isLast;
  }


  @JsonProperty(JSON_PROPERTY_IS_LAST)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setIsLast(Boolean isLast) {
    this.isLast = isLast;
  }


  public Page pageSizes(List<PageSize> pageSizes) {
    
    this.pageSizes = pageSizes;
    return this;
  }

  public Page addPageSizesItem(PageSize pageSizesItem) {
    if (this.pageSizes == null) {
      this.pageSizes = new ArrayList<>();
    }
    this.pageSizes.add(pageSizesItem);
    return this;
  }

   /**
   * Get pageSizes
   * @return pageSizes
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  @JsonProperty(JSON_PROPERTY_PAGE_SIZES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<PageSize> getPageSizes() {
    return pageSizes;
  }


  @JsonProperty(JSON_PROPERTY_PAGE_SIZES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPageSizes(List<PageSize> pageSizes) {
    this.pageSizes = pageSizes;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Page page = (Page) o;
    return Objects.equals(this.first, page.first) &&
        Objects.equals(this.previous, page.previous) &&
        Objects.equals(this.next, page.next) &&
        Objects.equals(this.last, page.last) &&
        Objects.equals(this.number, page.number) &&
        Objects.equals(this.size, page.size) &&
        Objects.equals(this.totalPages, page.totalPages) &&
        Objects.equals(this.totalItems, page.totalItems) &&
        Objects.equals(this.isFirst, page.isFirst) &&
        Objects.equals(this.isLast, page.isLast) &&
        Objects.equals(this.pageSizes, page.pageSizes);
  }

  @Override
  public int hashCode() {
    return Objects.hash(first, previous, next, last, number, size, totalPages, totalItems, isFirst, isLast, pageSizes);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Page {\n");
    sb.append("    first: ").append(toIndentedString(first)).append("\n");
    sb.append("    previous: ").append(toIndentedString(previous)).append("\n");
    sb.append("    next: ").append(toIndentedString(next)).append("\n");
    sb.append("    last: ").append(toIndentedString(last)).append("\n");
    sb.append("    number: ").append(toIndentedString(number)).append("\n");
    sb.append("    size: ").append(toIndentedString(size)).append("\n");
    sb.append("    totalPages: ").append(toIndentedString(totalPages)).append("\n");
    sb.append("    totalItems: ").append(toIndentedString(totalItems)).append("\n");
    sb.append("    isFirst: ").append(toIndentedString(isFirst)).append("\n");
    sb.append("    isLast: ").append(toIndentedString(isLast)).append("\n");
    sb.append("    pageSizes: ").append(toIndentedString(pageSizes)).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    ");
  }

}

