We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesAds KitAndroid-Javacom.huawei.hms.adsClass SummaryRequestOptions.Builder

RequestOptions.Builder

Expand

Class Info

public static class RequestOptions.Builder extends Object

Builder for global request configuration.

Public Constructor Summary

Expand

Constructor Name

Builder()

Constructs a builder for global request configuration.

Public Method Summary

Expand

Qualifier and Type

Method Name and Description

RequestOptions

build()

Constructs a RequestOptions object (global request configuration).

RequestOptions.Builder

setAdContentClassification(String adContentClassification)

Sets the maximum ad content rating.

RequestOptions.Builder

setAppCountry(String appCountry)

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

RequestOptions.Builder

setAppLang(String appLang)

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

RequestOptions.Builder

setConsent(String consent)

Sets the user consent string that complies with TCF v2.0.

RequestOptions.Builder

setNonPersonalizedAd(Integer nonPersonalizedAd)

Sets whether to request non-personalized ads.

RequestOptions.Builder

setRequestLocation(Boolean requestLocation)

Sets whether to carry location information in an ad request. By default, the information is carried.

RequestOptions.Builder

setTagForChildProtection(Integer tagForChildProtection)

Sets whether to process ad requests according to the COPPA.

RequestOptions.Builder

setTagForUnderAgeOfPromise(Integer tagForUnderAgeOfPromise)

Sets tags for users under the age of consent.

RequestOptions.Builder

setIsQueryUseEnabled(Integer isQueryUseEnabled)

Sets whether search keywords can be used.

RequestOptions.Builder

setTMax(Integer tMax)

Sets the maximum transaction timeout interval (including the network delay), in milliseconds.

RequestOptions.Builder

setCur(List<String> curs)

Sets the currency of the bid for a real-time bidding ad unit.

RequestOptions.Builder

addBiddingParamMap(String slotId, BiddingParam biddingParam)

Sets the parameters for a real-time bidding ad unit.

RequestOptions.Builder

setBiddingParamMap(Map<String, BiddingParam> biddingParamMap)

Sets the parameters for a real-time bidding ad unit.

Public Constructors

Builder

Expand

Constructor

public Builder()

Constructs a builder for global request configuration.

Public Methods

build

Expand

Method

public RequestOptions build()

Constructs a RequestOptions object (global request configuration).

Returns

Expand

Type

Description

RequestOptions

Global request configuration.

setAdContentClassification

Expand

Method

public RequestOptions.Builder setAdContentClassification(String adContentClassification)

Sets the maximum ad content rating.

Parameters

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

setAppCountry

Expand

Method

public RequestOptions.Builder setAppCountry(String appCountry)

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

Parameters

Expand

Name

Description

appCountry

Country/Region code corresponding to the language in which an ad needs to be returned for an app.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

setAppLang

Expand

Method

public RequestOptions.Builder setAppLang(String appLang)

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

Parameters

Expand

Name

Description

appLang

Language in which an ad needs to be returned for an app.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

setConsent

Expand

Method

public RequestOptions.Builder setConsent(String consent)

Sets the user consent string that complies with TCF v2.0.

Parameters

Expand

Name

Description

consent

User consent string, which complies with Consent String Format in TCF v2.0.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

setNonPersonalizedAd

Expand

Method

public RequestOptions.Builder setNonPersonalizedAd(Integer nonPersonalizedAd)

Sets whether to request non-personalized ads.

Parameters

Expand

Name

Description

nonPersonalizedAd

Setting indicating whether to request non-personalized ads.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

setRequestLocation

Expand

Method

public RequestOptions.Builder setRequestLocation(Boolean requestLocation)

Sets whether to carry location information in an ad request. By default, the information is carried.

Parameters

Expand

Name

Description

requestLocation

Indicates whether location information is carried in an ad request.

  • true: yes
  • false: no

The default value is true.

setTagForChildProtection

Expand

Method

public RequestOptions.Builder setTagForChildProtection(Integer tagForChildProtection)

Sets whether to process ad requests according to the COPPA.

Parameters

Expand

Name

Description

tagForChildProtection

Indicates whether to process ad requests according to the COPPA.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

setTagForUnderAgeOfPromise

Expand

Method

public RequestOptions.Builder setTagForUnderAgeOfPromise(Integer tagForUnderAgeOfPromise)

Sets tags for users under the age of consent.

Parameters

Expand

Name

Description

tagForUnderAgeOfPromise

Indicates whether to process ad requests as directed to users under the age of consent.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

setIsQueryUseEnabled

Expand

Method

public RequestOptions.Builder setIsQueryUseEnabled(Integer isQueryUseEnabled)

Sets whether search keywords can be used.

Parameters

Expand

Name

Description

isQueryUseEnabled

Indicates whether search keywords can be used. The options are as follows:

  • IsQueryUseEnabled.QUERY_USE_ENABLED
  • IsQueryUseEnabled.QUERY_USE_DISABLED

Returns

Expand

Type

Description

RequestOptions.Builder

Builder of RequestOptions.

setTMax

Expand

Method

public RequestOptions.Builder setTMax (Integer tMax)

Sets the maximum transaction timeout interval (including the network delay), in milliseconds.

Parameters

Expand

Name

Description

tMax

Maximum transaction timeout interval (including the network delay), in milliseconds.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for RequestOptions.

setCur

Expand

Method

public RequestOptions.Builder setCur(List<String> curs)

Sets the currency of the bid for a real-time bidding ad unit.

Parameters

Expand

Name

Description

curs

Currency supported by the bidding request. The value is of the List<String> type. Currently, the following options are supported: CNY, USD, EUR, GBP, and JPY. If this parameter is left empty, the default value CNY will be used.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for RequestOptions.

addBiddingParamMap

Expand

Method

public RequestOptions.Builder addBiddingParamMap(String slotId, BiddingParam biddingParam)

Sets the parameters for a real-time bidding ad unit.

Parameters

Expand

Name

Description

slotId

Ad unit ID. The real-time bidding parameters are set on a per ad unit basis.

biddingParam

BiddingParam object.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for RequestOptions.

setBiddingParamMap

Expand

Method

public RequestOptions.Builder setBiddingParamMap(Map<String, BiddingParam > biddingParamMap)

Sets the parameters for a real-time bidding ad unit.

Parameters

Expand

Name

Description

biddingParamMap

This parameter is of the Map type and set on a per ad unit basis. In the Map<String, BiddingParam> structure, the key represents an ad unit ID, and the value is a BiddingParam object.

Returns

Expand

Type

Description

RequestOptions.Builder

Builder for RequestOptions.