package de.nccloud.common.v0.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1 * User agent: apibuilder app.apibuilder.io/nccloud/common/0.0.1/android_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson and retrofit2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * * Form containing paging information. */ @JsonIgnoreProperties( ignoreUnknown = true ) public class PagingForm { private final Integer offset; private final Integer limit; private final Sort[] sort; @JsonCreator public PagingForm(@JsonProperty("offset") Integer offset, @JsonProperty("limit") Integer limit, @JsonProperty("sort") Sort[] sort) { this.offset = offset; this.limit = limit; this.sort = sort; } /** * Offset of the current page. The pages are 0-indexed, meaning the first page starts at 0. */ public Integer getOffset() { return offset; } /** * The number of results to be returned by the api. */ public Integer getLimit() { return limit; } /** * Defines multiple properties for the results to be sorted by. The order of the definition defines the priority. If omitted, the service will use an implementation dependent default sort. */ public Sort[] getSort() { return sort; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PagingForm that = (PagingForm) o; if (offset != null ? !offset.equals(that.offset) : that.offset != null) return false; if (limit != null ? !limit.equals(that.limit) : that.limit != null) return false; if (!Arrays.equals(sort, that.sort)) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (offset != null ? offset.hashCode() : 0); result = 31 * result + (limit != null ? limit.hashCode() : 0); result = 31 * result + (sort != null ? sort.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return de.nccloud.common.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static PagingForm parseJson(String json) throws IOException { return de.nccloud.common.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, PagingForm.class); } }