public class TargetingParams
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TargetingParams.GENDER |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCustomKeywords()
Clear all custom keywords.
|
static int |
getAge()
Get the age for targeting
|
static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
getCustomKeywords()
Retrieve the array of custom keywords that will passed to demand sources.
|
static TargetingParams.GENDER |
getGender()
Get the current user's gender, if it's available.
|
static Location |
getLocation()
Retrieve the location that's set by setLocation()
|
static int |
getLocationDecimalDigits()
Get the digits after the decimal of the latitude and longitude.
|
static boolean |
getLocationEnabled()
Returns true if the Prebid sdk is allowed to use location information
or false otherwise.
|
static void |
removeCustomKeyword(java.lang.String key)
Remove a custom keyword from the targeting params.
|
static void |
setAge(int age)
Set the age for targeting
|
static void |
setCustomTargeting(java.lang.String key,
java.util.ArrayList<java.lang.String> values)
Set a custom key/values pair for customized targeting.
|
static void |
setCustomTargeting(java.lang.String key,
java.lang.String value)
Set a custom key/value pair for customized targeting.
|
static void |
setGender(TargetingParams.GENDER gender)
Set the user's gender.
|
static void |
setLocation(Location locationData)
Set the location for demand sources to target
|
static void |
setLocationDecimalDigits(int digitsAfterDecimal)
Sets the number of digits after the decimal of the latitude and longitude.
|
static void |
setLocationEnabled(boolean enabled)
Sets whether or not location (latitude, longitude) is retrieved through provider and
shared with 3rd party networks.
|
public static int getAge()
public static void setAge(int age)
age - age of the userpublic static TargetingParams.GENDER getGender()
public static void setGender(TargetingParams.GENDER gender)
gender - The user's gender.public static void setLocationEnabled(boolean enabled)
enabled - default is false.public static boolean getLocationEnabled()
public static Location getLocation()
public static void setLocation(Location locationData)
locationData - location of the userpublic static int getLocationDecimalDigits()
public static void setLocationDecimalDigits(int digitsAfterDecimal)
getLocationEnabled().
Maximum of precision is 6, which means less than a foot.digitsAfterDecimal - The digitspublic static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getCustomKeywords()
public static void removeCustomKeyword(java.lang.String key)
key - The key to remove; this should not be null or empty.public static void setCustomTargeting(java.lang.String key,
java.lang.String value)
key - The key to add; this should not be null or empty.value - The value to add; this should not be null or empty.public static void setCustomTargeting(java.lang.String key,
java.util.ArrayList<java.lang.String> values)
key - The key to add; this should not be null or empty.values - The values to add; this should not be null or empty.public static void clearCustomKeywords()