com.banxa.model.request.PaginatedGetRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk Show documentation
Show all versions of java-sdk Show documentation
The Java SDK for integration with Banxa's API
The newest version!
package com.banxa.model.request;
public abstract class PaginatedGetRequest extends GetRequest {
private final Integer perPage;
private Integer page;
public PaginatedGetRequest(Builder> builder) {
this.perPage = builder.perPage;
this.page = builder.page;
}
public Integer getPerPage() {
return perPage;
}
public Integer getPage() {
return page;
}
public void nextPage() {
page = page + 1;
}
public void previousPage() {
page = page - 1;
}
public static abstract class Builder > {
private Integer perPage;
private Integer page = 1;
public Builder() {
}
public T withPerPage(Integer perPage) {
this.perPage = perPage;
return (T) this;
}
public T withPage(Integer page) {
this.page = page;
return (T) this;
}
}
}