Package com.pubmatic.sdk.common.utility
Class POBExtensionsKt
-
- All Implemented Interfaces:
public final class POBExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static JSONObjectputIfNotNullOrEmpty(JSONObject $self, String key, String value)Extension function to add key-value only if the value is not null or empty final static JSONObjectputIfNotEmpty(JSONObject $self, String key, JSONObject value)Extension function to add a key-value pair to a JSONObject only if the value JSONObject is not empty. -
-
Method Detail
-
putIfNotNullOrEmpty
final static JSONObject putIfNotNullOrEmpty(JSONObject $self, String key, String value)
Extension function to add key-value only if the value is not null or empty
- Parameters:
key- The key under which thejsonValuewill be added.value- Value to be added to the currentJSONObject.
-
putIfNotEmpty
final static JSONObject putIfNotEmpty(JSONObject $self, String key, JSONObject value)
Extension function to add a key-value pair to a JSONObject only if the value JSONObject is not empty.
- Parameters:
key- The key under which thevaluewill be added.value- The JSONObject to be added.
-
-
-
-