public class POBRequestBuilder
extends java.lang.Object
implements com.pubmatic.sdk.common.base.POBRequestBuilding
| Constructor and Description |
|---|
POBRequestBuilder(POBRequest request,
java.lang.String url,
android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
addParamToJson(org.json.JSONObject json,
java.lang.String key,
java.lang.String param)
Utitity method to pub key values to provided json object
|
com.pubmatic.sdk.common.network.POBHttpRequest |
build()
Method prepares the PMHttpRequest from the necessary member variables
|
org.json.JSONObject |
getAppJson(java.lang.String publisherId)
Used to get app json.
|
org.json.JSONObject |
getBody()
Create ortb request body for ad
|
org.json.JSONArray |
getCurrencyJson()
Get currency json array
|
org.json.JSONObject |
getDeviceObject()
Builds oRTB specific device info json, Internally it uses device info
POBDeviceInfo to
fetch device specific values. |
org.json.JSONObject |
getRegsJson()
Create ortb regs json for ad request
|
com.pubmatic.sdk.common.network.POBHttpRequest |
prepareHttpRequest(java.lang.String serverUrl,
java.lang.String body,
java.lang.String ortbVersion)
Prepare Ortb Http POST request, it also follows request timeout provided in POBRequest
|
void |
setAppInfo(com.pubmatic.sdk.common.models.POBAppInfo appInfo)
The method takes value of PMAppInfo and set it to specific
reference variable
|
void |
setDeviceInfo(com.pubmatic.sdk.common.models.POBDeviceInfo deviceInfo)
The method takes value of PMDeviceInfo and set it to
specific reference variable
|
void |
setLocationDetector(com.pubmatic.sdk.common.utility.POBLocationDetector locationDetector)
The method takes PMLocationDetector object and sets it to
specific reference variable
|
public POBRequestBuilder(POBRequest request, java.lang.String url, @NonNull android.content.Context context)
public com.pubmatic.sdk.common.network.POBHttpRequest build()
build in interface com.pubmatic.sdk.common.base.POBRequestBuildingpublic void setDeviceInfo(com.pubmatic.sdk.common.models.POBDeviceInfo deviceInfo)
setDeviceInfo in interface com.pubmatic.sdk.common.base.POBRequestBuildingdeviceInfo - value PMDeviceInfo objectpublic void setAppInfo(com.pubmatic.sdk.common.models.POBAppInfo appInfo)
setAppInfo in interface com.pubmatic.sdk.common.base.POBRequestBuildingappInfo - value of type PMAppInfopublic void setLocationDetector(com.pubmatic.sdk.common.utility.POBLocationDetector locationDetector)
setLocationDetector in interface com.pubmatic.sdk.common.base.POBRequestBuildinglocationDetector - value of LocationDetector object@NonNull
public com.pubmatic.sdk.common.network.POBHttpRequest prepareHttpRequest(@NonNull
java.lang.String serverUrl,
@NonNull
java.lang.String body,
@Nullable
java.lang.String ortbVersion)
serverUrl - the server url for which request is going to performbody - the request body which is passed while making requestortbVersion - the ortb version, if not null passed to request headerspublic org.json.JSONObject getBody()
@NonNull public org.json.JSONArray getCurrencyJson()
public org.json.JSONObject getAppJson(java.lang.String publisherId)
publisherId - the publisher id for which user json is build.public org.json.JSONObject getDeviceObject()
POBDeviceInfo to
fetch device specific values.public org.json.JSONObject getRegsJson()
public void addParamToJson(org.json.JSONObject json,
java.lang.String key,
java.lang.String param)
json - the json on which operation to be performedkey - the key which is going to add on provided jsonparam - the value specific to the key which is going to add on provided json