Class Response
java.lang.Object
com.centralnicreseller.apiconnector.Response
Response covers all functionality to wrap a Backend API Response like
accessing data
- Since:
- 2.0
- Version:
- %I%, %G%
- Author:
- Kai Schwarz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a column to the column list.Add a record to the record list.int
getCode()
Get API response codeGet column by column name.getColumnIndex
(String colkey, int index) Get Data by Column Name and Index.Get Column Names.Get List of Columns.Get Command used in this request.Get Command used in this request in plain text.int
Get Page Number of current List Query.Get Record of current record index.Get API response descriptionint
Get Index of first row in this response.getHash()
Get API response as Hashint
Get last record index of the current list query.Get Response as List Hash including useful meta data for tables.int
Get Page Number of next list query.Get next record in record list.int
Get the number of pages available for this list query.Get object containing all paging data.getPlain()
Get Plain API responseint
Get Page Number of previous list query.Get previous record in record list.double
Get Queuetime of API responsegetRecord
(int idx) Get Record at given index.Get all Records.int
Get count of rows in this responseint
Get limit(ation) setting of the current list query This is the count of requested rowsint
Get total count of records available for the list query.double
Get Runtime of API responseboolean
Check if this list query has a next pageboolean
Check if this list query has a previous pageboolean
isError()
Check if current API response represents an error case API response code is an 5xx codeboolean
Check if current operation is returned as pending.boolean
Check if current API response represents a success case API response code is an 2xx codeboolean
Check if current API response represents a temporary error case API response code is an 4xx codeReset index in record list back to zero
-
Constructor Details
-
Response
-
Response
-
Response
-
-
Method Details
-
getCode
public int getCode()Get API response code- Returns:
- API response code
-
getDescription
-
getPlain
-
getQueuetime
public double getQueuetime()Get Queuetime of API response- Returns:
- Queuetime of API response
-
getHash
-
getRuntime
public double getRuntime()Get Runtime of API response- Returns:
- Runtime of API response
-
isError
public boolean isError()Check if current API response represents an error case API response code is an 5xx code- Returns:
- boolean result
-
isSuccess
public boolean isSuccess()Check if current API response represents a success case API response code is an 2xx code- Returns:
- boolean result
-
isTmpError
public boolean isTmpError()Check if current API response represents a temporary error case API response code is an 4xx code- Returns:
- boolean result
-
isPending
public boolean isPending()Check if current operation is returned as pending.- Returns:
- boolean result
-
addColumn
-
addRecord
-
getColumn
-
getColumnIndex
-
getColumnKeys
-
getColumns
-
getCommand
-
getCommandPlain
Get Command used in this request in plain text.- Returns:
- plain text command
-
getCurrentPageNumber
public int getCurrentPageNumber()Get Page Number of current List Query.- Returns:
- page number or -1 in case of a non-list response
-
getCurrentRecord
Get Record of current record index.- Returns:
- Record or null in case of a non-list response
-
getFirstRecordIndex
public int getFirstRecordIndex()Get Index of first row in this response.- Returns:
- first row index; -1 if record list is empty
-
getLastRecordIndex
public int getLastRecordIndex()Get last record index of the current list query.- Returns:
- record index or -1 for a non-list response
-
getListHash
-
getNextRecord
Get next record in record list.- Returns:
- Record or null in case there's no further record
-
getNextPageNumber
public int getNextPageNumber()Get Page Number of next list query.- Returns:
- page number or -1 if there's no next page
-
getNumberOfPages
public int getNumberOfPages()Get the number of pages available for this list query.- Returns:
- number of pages
-
getPagination
-
getPreviousPageNumber
public int getPreviousPageNumber()Get Page Number of previous list query.- Returns:
- page number or -1 if there's no previous page
-
getPreviousRecord
Get previous record in record list.- Returns:
- Record or null if there's no previous record
-
getRecord
Get Record at given index.- Parameters:
idx
- record index- Returns:
- Record or null if index does not exist
-
getRecords
-
getRecordsCount
public int getRecordsCount()Get count of rows in this response- Returns:
- count of rows
-
getRecordsTotalCount
public int getRecordsTotalCount()Get total count of records available for the list query.- Returns:
- total count of records or count of records for a non-list response
-
getRecordsLimitation
public int getRecordsLimitation()Get limit(ation) setting of the current list query This is the count of requested rows- Returns:
- limit setting or count requested rows
-
hasNextPage
public boolean hasNextPage()Check if this list query has a next page- Returns:
- boolean result
-
hasPreviousPage
public boolean hasPreviousPage()Check if this list query has a previous page- Returns:
- boolean result
-
rewindRecordList
Reset index in record list back to zero- Returns:
- Current Response Instance for method chaining
-