com.jelastic.api.billing.response.PagedArrayResponse Maven / Gradle / Ivy
The newest version!
/*Server class MD5: b456b18f2c53efc4e33e9b40c53708f3*/
package com.jelastic.api.billing.response;
import com.jelastic.api.billing.response.interfaces.ArrayItem;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Collection;
import java.util.Set;
/**
* @author Volodymyr Studzinskyy
*/
/**
* @name Jelastic API Client
* @version 8.11.2
* @copyright Jelastic, Inc.
*/
public class PagedArrayResponse extends ArrayResponse {
private long totalCount;
public PagedArrayResponse() {
super();
}
public PagedArrayResponse(int result, String error) {
super(result, error);
}
public PagedArrayResponse(Class> generic, Collection extends ArrayItem> array, long totalCount) {
super(generic, array);
this.totalCount = totalCount;
}
public PagedArrayResponse(Class> generic, Collection extends ArrayItem> array, long totalCount, Set expandablePath) {
super(generic, array, expandablePath);
this.totalCount = totalCount;
}
public PagedArrayResponse(Class> generic, Collection extends ArrayItem> array, long totalCount, String expandablePath) {
super(generic, array, expandablePath);
this.totalCount = totalCount;
}
public long getTotalCount() {
return totalCount;
}
public void setTotalCount(long totalCount) {
this.totalCount = totalCount;
}
@Override
protected PagedArrayResponse _fromJSON(JSONObject json) throws JSONException {
super._fromJSON(json);
if (json.has("totalCount")) {
this.totalCount = json.getLong("totalCount");
}
return this;
}
@Override
protected JSONObject _toJSON() throws JSONException {
JSONObject json = super._toJSON();
json.put("totalCount", totalCount);
return json;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy