org.oxerr.viagogo.model.response.PagedResource Maven / Gradle / Ivy
package org.oxerr.viagogo.model.response;
import java.io.Serializable;
import java.util.List;
import javax.annotation.CheckForNull;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import io.openapitools.jackson.dataformat.hal.HALLink;
import io.openapitools.jackson.dataformat.hal.annotation.EmbeddedResource;
import io.openapitools.jackson.dataformat.hal.annotation.Link;
@io.openapitools.jackson.dataformat.hal.annotation.Resource
public class PagedResource extends Resource {
private static final long serialVersionUID = 2023021301L;
private Integer totalItems;
private Integer page;
private Integer pageSize;
@EmbeddedResource
private List deletedItems;
@EmbeddedResource
private List items;
@Link("next")
private HALLink nextLink;
@Link("prev")
private HALLink prevLink;
@Link("first")
private HALLink firstLink;
@Link("last")
private HALLink lastLink;
public Integer getTotalItems() {
return totalItems;
}
public void setTotalItems(Integer totalItems) {
this.totalItems = totalItems;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public List getDeletedItems() {
return deletedItems;
}
public void setDeletedItems(List deletedItems) {
this.deletedItems = deletedItems;
}
public List getItems() {
return items;
}
public void setItems(List items) {
this.items = items;
}
@CheckForNull
public HALLink getNextLink() {
return nextLink;
}
public void setNextLink(HALLink nextLink) {
this.nextLink = nextLink;
}
@CheckForNull
public HALLink getPrevLink() {
return prevLink;
}
public void setPrevLink(HALLink prevLink) {
this.prevLink = prevLink;
}
@CheckForNull
public HALLink getFirstLink() {
return firstLink;
}
public void setFirstLink(HALLink firstLink) {
this.firstLink = firstLink;
}
@CheckForNull
public HALLink getLastLink() {
return lastLink;
}
public void setLastLink(HALLink lastLink) {
this.lastLink = lastLink;
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
@SuppressWarnings("unchecked")
PagedResource rhs = (PagedResource) obj;
return EqualsBuilder.reflectionEquals(this, rhs);
}
}