Params

open class Params

The Params class is useful to assemble params values for the request

Constructors

Link copied to clipboard
constructor()
Constructor to init Params No-any params required
constructor(mergeParams: APIRequest.Params)
Constructor to init Params

Properties

Link copied to clipboard
private val apiRequest: APIRequest
apiRequest is the instance for APIRequest object
Link copied to clipboard
private val params: HashMap<String, Any>
params is the instance that contains params value

Functions

Link copied to clipboard
open fun <T> addParam(keyParam: String, valueParam: T)
Method to add a new param value
Link copied to clipboard
open fun clear()
Method to clear all params No-any params required
Link copied to clipboard
open fun createJSONPayload(): JSONObject
Method to assemble a body params of an "HTTP" request No-any params required
open fun createJSONPayload(extraPayload: APIRequest.Params): JSONObject
Method to assemble a body params of an "HTTP" request
Link copied to clipboard
open fun createPayload(): String
Method to assemble a body params of an "HTTP" request No-any params required
open fun createPayload(extraPayload: APIRequest.Params): String
Method to assemble a body params of an "HTTP" request
Link copied to clipboard
Method to assemble a query params string No-any params required
open fun createQueryString(mandatoryParams: APIRequest.Params): String
open fun createQueryString(mandatoryParams: String): String
Method to assemble a query params string
Link copied to clipboard
open fun <T> getAllParams(): Collection<T>
Method to get all params value No-any params required
Link copied to clipboard
open fun <T> getParam(paramKey: String): T
Method to get a param value
Link copied to clipboard
open fun getParamsKeys(): Set<String>
Method to get all params keys No-any params required
Link copied to clipboard
open fun mergeParams(mergeParams: APIRequest.Params)
Method to merge another params value in the same object
Link copied to clipboard
open fun removeParam(keyParam: String)
Method to remove a param
Link copied to clipboard
open fun toString(): String
Returns a string representation of the object No-any params required