目录

public static final class AdParam.Builder extends ObjectCLASS info
public static final class AdParam.Builder extends Object
Ad request builder.

Public Constructor Summary

Constructor name
Builder()
Ad request builder constructor.

Public Method Summary

Return typeMethod name
AdParambuild()
Builds an ad param object.
AdParam.BuildersetGender(int gender)
Sets the gender.
AdParam.BuildersetAdContentClassification(String adContentClassification)
Sets the ad content rating.
AdParam.BuildersetTagForUnderAgeOfPromise(Integer tagForUnderAgeOfPromise)
Specifies whether to process ad requests as directed to users under the age of consent.
AdParam.BuildersetTagForChildProtection(Integer tagForChildProtection)
Specifies whether to process ad requests according to the COPPA.
AdParam.BuildersetNonPersonalizedAd(Integer nonPersonalizedAd)
Specifies whether to request personalized ads.
AdParam.Builder

setAppCountry(String appCountry)

Sets the country code corresponding to the language in which an ad needs to be returned for an app.
AdParam.Builder

setAppLang(String appLang)

Sets the language in which an ad needs to be returned for an app.
AdParam.Builder

setBelongCountryCode(String countryCode)

Sets the home country code.

Public Constructors

Constructor
public Builder()
Ad request builder constructor.

Public Methods

Method
public final AdParam build()
Builds an ad request. If an error occurs, null is returned.


Return

typedesc
AdParamAd param.
Method
public final AdParam.Builder setGender(int gender)
Sets the gender.


Parameters

Parameter nameParameter desc
genderGender.


Return

typedesc
AdParam.BuilderAd param builder.
Method
public final AdParam.Builder setAdContentClassification(String adContentClassification)
Sets the ad content rating.


Parameters

Parameter nameParameter desc
adContentClassificationAd content rating.
The options are as follows:

ContentClassification.AD_CONTENT_CLASSIFICATION_W

ContentClassification.AD_CONTENT_CLASSIFICATION_PI
ContentClassification.AD_CONTENT_CLASSIFICATION_J
ContentClassification.AD_CONTENT_CLASSIFICATION_A


Return

typedesc
AdParam.BuilderAd param builder.
Method
public final AdParam.Builder setTagForUnderAgeOfPromise(Integer tagForUnderAgeOfPromise)
Specifies whether to process ad requests as directed to users under the age of consent.


Parameters

Parameter nameParameter desc
tagForUnderAgeOfPromiseIndicates whether to process ad requests as underage user–directed.
The options are as follows:

UnderAge.PROMISE_UNSPECIFIED

UnderAge.PROMISE_FALSE
UnderAge.PROMISE_TRUE


Return

typedesc
AdParam.BuilderAd param builder.
Method
public final AdParam.Builder setTagForChildProtection(Integer tagForChildProtection)
Specifies whether to process ad requests according to the COPPA.


Parameters

Parameter nameParameter desc
tagForChildProtectionIndicates whether to process ad requests according to the COPPA.
The options are as follows:

TagForChild.TAG_FOR_CHILD_PROTECTION_UNSPECIFIED

TagForChild.TAG_FOR_CHILD_PROTECTION_FALSE
TagForChild.TAG_FOR_CHILD_PROTECTION_TRUE


Return

typedesc
AdParam.BuilderAd param builder.
Method
public final AdParam.Builder setNonPersonalizedAd(Integer nonPersonalizedAd)
Specifies whether to request personalized ads.


Parameters

Parameter nameParameter desc
nonPersonalizedAdThe options are as follows:

NonPersonalizedAd.ALLOW_NON_PERSONALIZED

NonPersonalizedAd.ALLOW_ALL


Return

typedesc
AdParam.BuilderAd param builder.
Method
public final AdParam.Builder setAppCountry(String appCountry)
Sets the country code corresponding to the language in which an ad needs to be returned for an app.


Parameters

Parameter nameParameter desc
appCountryCountry code corresponding to the language in which an ad needs to be returned for an app.


Return

typedesc
AdParam.BuilderAd param builder.
Method
public final AdParam.Builder setAppLang(String appLang)
Sets the language in which an ad needs to be returned for an app.


Parameters

Parameter nameParameter desc
appLangLanguage in which an ad needs to be returned for an app.


Return

typedesc
AdParam.BuilderAd param builder.
Method
public final AdParam.Builder setBelongCountryCode(String countryCode)
Sets the home country code.


Parameters

Parameter nameParameter desc
countryCode
Code of the country to which multimedia belongs.


Return

typedesc
AdParam.BuilderAd param builder.