Package com.yandex.mobile.ads.nativeads
Class NativeAdRequestConfiguration.Builder
- java.lang.Object
-
- com.yandex.mobile.ads.nativeads.NativeAdRequestConfiguration.Builder
-
- Enclosing class:
- NativeAdRequestConfiguration
public static final class NativeAdRequestConfiguration.Builder extends java.lang.Object
Builds anNativeAdRequestConfiguration
.
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String adUnitId)
Creates a newNativeAdRequestConfiguration.Builder
for constructing aNativeAdRequestConfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NativeAdRequestConfiguration
build()
Constructs anNativeAdRequestConfiguration
with the specified attributes.NativeAdRequestConfiguration.Builder
setAge(java.lang.String age)
Sets current user age entered inside the app.NativeAdRequestConfiguration.Builder
setBiddingData(java.lang.String biddingData)
Sets bid Id.NativeAdRequestConfiguration.Builder
setContextQuery(java.lang.String contextQuery)
Sets current user query entered inside the app.NativeAdRequestConfiguration.Builder
setContextTags(java.util.List<java.lang.String> contextTags)
Sets tags describing current user context inside the app.NativeAdRequestConfiguration.Builder
setGender(java.lang.String gender)
Sets user gender entered inside the app.NativeAdRequestConfiguration.Builder
setLocation(android.location.Location location)
Sets the user's mLocation for targeting process.NativeAdRequestConfiguration.Builder
setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Sets custom mParameters.NativeAdRequestConfiguration.Builder
setShouldLoadImagesAutomatically(boolean shouldLoadImagesAutomatically)
Sets whether images should be loaded automatically.
-
-
-
Constructor Detail
-
Builder
public Builder(@NonNull java.lang.String adUnitId)
Creates a newNativeAdRequestConfiguration.Builder
for constructing aNativeAdRequestConfiguration
- 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 anNativeAdRequestConfiguration
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 totrue
. Otherwise, images should be loaded manually with loadImages methodNativeAd.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.
-
-