Enclosing class:
NativeAdRequestConfiguration


public static final class NativeAdRequestConfiguration.Builder
extends java.lang.Object

Constructor Summary

Constructors
Constructor and Description
Builder(java.lang.String adUnitId)

Method Summary

All Methods
Instance Methods
Concrete Methods
Modifier and TypeMethod and Description
NativeAdRequestConfigurationbuild()
Constructs an NativeAdRequestConfiguration with the specified attributes.
NativeAdRequestConfiguration.BuildersetAge(java.lang.String age)
Sets current user age entered inside the app.
NativeAdRequestConfiguration.BuildersetBiddingData(java.lang.String biddingData)
Sets bid Id.
NativeAdRequestConfiguration.BuildersetContextQuery(java.lang.String contextQuery)
Sets current user query entered inside the app.
NativeAdRequestConfiguration.BuildersetContextTags(java.util.List<java.lang.String> contextTags)
Sets tags describing current user context inside the app.
NativeAdRequestConfiguration.BuildersetGender(java.lang.String gender)
Sets user gender entered inside the app.
NativeAdRequestConfiguration.BuildersetLocation(android.location.Location location)
Sets the user's mLocation for targeting process.
NativeAdRequestConfiguration.BuildersetParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Sets custom mParameters.
NativeAdRequestConfiguration.BuildersetPreferredTheme​(com.yandex.mobile.ads.common.AdTheme preferredTheme)
Sets preferred theme.
NativeAdRequestConfiguration.BuildersetShouldLoadImagesAutomatically(boolean shouldLoadImagesAutomatically)
Sets whether images should be loaded automatically.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Builder

public Builder(@NonNull
               java.lang.String adUnitId)
Parameters:
adUnitId - Unique ad placement ID, created at partner interface. Identifies ad placement for specific application. Example: R-M-XXXXXX-Y.

Method Detail

build

@NonNull
public NativeAdRequestConfiguration build()
Constructs an NativeAdRequestConfiguration with the specified attributes.
Returns:
NativeAdRequestConfiguration.

setShouldLoadImagesAutomatically

@NonNull
public NativeAdRequestConfiguration.Builder setShouldLoadImagesAutomatically(boolean shouldLoadImagesAutomatically)
Sets whether images should be loaded automatically.
Parameters:
shouldLoadImagesAutomatically - Determines if ad images should be loaded as a part of ad loading process. All images will be loaded and ready to be used if set to true. Otherwise, images should be loaded manually with loadImages method NativeAd.loadImages().

setAge

@NonNull
public NativeAdRequestConfiguration.Builder setAge(@NonNull
                                                            java.lang.String age)
Sets current user age entered inside the app. Used for targeting.
Parameters:
age - for targeting process.
Returns:
AdRequest.Builder with user age.

setContextQuery

@NonNull
public NativeAdRequestConfiguration.Builder setContextQuery(@NonNull
                                                                     java.lang.String contextQuery)
Sets current user query entered inside the app. Used for targeting.
Parameters:
contextQuery - for targeting process.
Returns:
AdRequest.Builder with user query.

setContextTags

@NonNull
public NativeAdRequestConfiguration.Builder setContextTags(@NonNull
                                                                    java.util.List<java.lang.String> contextTags)
Sets tags describing current user context inside the app. Used for targeting.
Parameters:
contextTags - for targeting process.
Returns:
AdRequest.Builder with user tags.

setGender

@NonNull
public NativeAdRequestConfiguration.Builder setGender(@NonNull
                                                               java.lang.String gender)
Sets user gender entered inside the app. Used for targeting.
Parameters:
gender - for targeting process.
Returns:
AdRequest.Builder with user gender.

setLocation

@NonNull
public NativeAdRequestConfiguration.Builder setLocation(@NonNull
                                                                 android.location.Location location)
Sets the user's mLocation for targeting process.
Parameters:
location - for targeting process.
Returns:
AdRequest.Builder with user's mLocation.

setParameters

@NonNull
public NativeAdRequestConfiguration.Builder setParameters(@NonNull
                                                                   java.util.Map<java.lang.String,java.lang.String> parameters)
Sets custom mParameters.
Parameters:
parameters - custom mParameters.
Returns:
AdRequest.Builder with custom mParameters.

setBiddingData

@NonNull
public NativeAdRequestConfiguration.Builder setBiddingData(@NonNull
                                                                    java.lang.String biddingData)
Sets bid Id.
Parameters:
biddingData - bidding data for ad loading from mediation.
Returns:
AdRequest.Builder with custom bid id.

setPreferredTheme

@NonNull
public NativeAdRequestConfiguration.Builder setPreferredTheme​(@Nullable
                                           com.yandex.mobile.ads.common.AdTheme preferredTheme)
Sets preferred theme.
Parameters:
preferredTheme - preferred ad theme.
Returns:
NativeAdRequestConfiguration.Builder with preferred theme.