目录

RequestOptions.Builder

Class Info

public static class RequestOptions.Builder extends Object

Builder for global request configuration.

Public Constructor Summary

Constructor Name

Builder()

Constructs a builder for global request configuration.

Public Method Summary

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

[h2]Builder

Constructor

public Builder()

Constructs a builder for global request configuration.

Public Methods

[h2]build

Method

public RequestOptions build()

Constructs a RequestOptions object (global request configuration).

Returns

Type

Description

RequestOptions

Global request configuration.

[h2]setAdContentClassification

Method

public RequestOptions.Builder setAdContentClassification(String adContentClassification)

Sets the maximum ad content rating.

Parameters

Returns

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

[h2]setAppCountry

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

Name

Description

appCountry

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

Returns

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

[h2]setAppLang

Method

public RequestOptions.Builder setAppLang(String appLang)

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

Parameters

Name

Description

appLang

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

Returns

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

[h2]setConsent

Method

public RequestOptions.Builder setConsent(String consent)

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

Parameters

Name

Description

consent

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

Returns

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

[h2]setNonPersonalizedAd

Method

public RequestOptions.Builder setNonPersonalizedAd(Integer nonPersonalizedAd)

Sets whether to request non-personalized ads.

Parameters

Name

Description

nonPersonalizedAd

Setting indicating whether to request non-personalized ads.

Returns

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

[h2]setRequestLocation

Method

public RequestOptions.Builder setRequestLocation(Boolean requestLocation)

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

Parameters

Name

Description

requestLocation

Indicates whether location information is carried in an ad request.

  • true: yes
  • false: no

The default value is true.

[h2]setTagForChildProtection

Method

public RequestOptions.Builder setTagForChildProtection(Integer tagForChildProtection)

Sets whether to process ad requests according to the COPPA.

Parameters

Name

Description

tagForChildProtection

Indicates whether to process ad requests according to the COPPA.

Returns

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

[h2]setTagForUnderAgeOfPromise

Method

public RequestOptions.Builder setTagForUnderAgeOfPromise(Integer tagForUnderAgeOfPromise)

Sets tags for users under the age of consent.

Parameters

Name

Description

tagForUnderAgeOfPromise

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

Returns

Type

Description

RequestOptions.Builder

Builder for a RequestOptions object.

[h2]setIsQueryUseEnabled

Method

public RequestOptions.Builder setIsQueryUseEnabled(Integer isQueryUseEnabled)

Sets whether search keywords can be used.

Parameters

Name

Description

isQueryUseEnabled

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

  • IsQueryUseEnabled.QUERY_USE_ENABLED
  • IsQueryUseEnabled.QUERY_USE_DISABLED

Returns

Type

Description

RequestOptions.Builder

Builder of RequestOptions.

[h2]setTMax

Method

public RequestOptions.Builder setTMax (Integer tMax)

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

Parameters

Name

Description

tMax

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

Returns

Type

Description

RequestOptions.Builder

Builder for RequestOptions.

[h2]setCur

Method

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

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

Parameters

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

Type

Description

RequestOptions.Builder

Builder for RequestOptions.

[h2]addBiddingParamMap

Method

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

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

Parameters

Name

Description

slotId

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

biddingParam

BiddingParam object.

Returns

Type

Description

RequestOptions.Builder

Builder for RequestOptions.

[h2]setBiddingParamMap

Method

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

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

Parameters

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

Type

Description

RequestOptions.Builder

Builder for RequestOptions.