Class POBAdResponse.Builder
-
- All Implemented Interfaces:
public class POBAdResponse.Builder<T extends POBAdDescriptor>Builder definition to build POBAdResponse class
-
-
Constructor Summary
Constructors Constructor Description POBAdResponse.Builder(List<T> bids)Constructor with the list of all bids POBAdResponse.Builder(POBAdResponse<T> adResponse)Constructor with the ad response POBAdResponse.Builder(JSONObject customData)Constructor with the JSON object
-
Method Summary
Modifier and Type Method Description POBAdResponse.Builder<T>updateWinningBid(@NonNull() T winningBid)Update the winning bid in the adResponse builder, This will update all respective bids to make winning bid consistent across adResponse like bids, serverSidePartnerBids POBAdResponse.Builder<T>updateWithRefreshIntervalAndExpiryTimeout(@NonNull() POBAdFormat adFormat)Updates all bids in the ad response (bids, serverSidePartnerBids, and winningBid) with the current refresh interval and the appropriate expiry timeout based on the provided ad format. POBAdResponse.Builder<T>setSendAllBidsState(boolean state)Sets the state of the SendAllBids flag POBAdResponse<T>build()Builds the instance of the POBAdResponse based on provided details. POBAdResponse.Builder<T>setServerSidePartnerBids(List<T> serverSidePartnerBids)Update the server-side Partner bids in the adResponse builder POBAdResponse.Builder<T>setWinningBid(@Nullable() T winningBid)Sets the winning bid POBAdResponse.Builder<T>setNextHighestDynamicBid(@Nullable() T nextHighestDynamicBid)POBAdResponse.Builder<T>setRefreshInterval(int refreshInterval)Sets the refresh interval POBAdResponse.Builder<T>setNbrCode(@Nullable() Integer nbrCode)Sets the nbr code -
-
Constructor Detail
-
POBAdResponse.Builder
POBAdResponse.Builder(List<T> bids)
Constructor with the list of all bids- Parameters:
bids- List of bids
-
POBAdResponse.Builder
POBAdResponse.Builder(POBAdResponse<T> adResponse)
Constructor with the ad response- Parameters:
adResponse- ad response object
-
POBAdResponse.Builder
POBAdResponse.Builder(JSONObject customData)
Constructor with the JSON object- Parameters:
customData- JSON object of an Ad response
-
-
Method Detail
-
updateWinningBid
POBAdResponse.Builder<T> updateWinningBid(@NonNull() T winningBid)
Update the winning bid in the adResponse builder, This will update all respective bids to make winning bid consistent across adResponse like bids, serverSidePartnerBids
- Parameters:
winningBid- bid instance to be update- Returns:
Returns updated instance
-
updateWithRefreshIntervalAndExpiryTimeout
POBAdResponse.Builder<T> updateWithRefreshIntervalAndExpiryTimeout(@NonNull() POBAdFormat adFormat)
Updates all bids in the ad response (bids, serverSidePartnerBids, and winningBid) with the current refresh interval and the appropriate expiry timeout based on the provided ad format.
The expiry timeout for each bid is determined by getExpiryTimeout:
- For BANNER, BANNER_AND_MREC, and MREC:
- If the bid is a video, uses BID_EXPIRE_TIME_IN_MILLIS.
- Otherwise, uses BANNER_BID_EXPIRE_TIME_IN_MILLIS.
- For APP_OPEN_AD:
- For all other formats (e.g., INTERSTITIAL, REWARDEDAD, NATIVE):
- Parameters:
adFormat- The ad format used to determine the expiry timeout for each bid.- Returns:
The updated ad response builder.
- For BANNER, BANNER_AND_MREC, and MREC:
-
setSendAllBidsState
POBAdResponse.Builder<T> setSendAllBidsState(boolean state)
Sets the state of the SendAllBids flag
- Parameters:
state- true if the send all bid state is enabled else false- Returns:
Returns updated instance
-
build
@NonNull() POBAdResponse<T> build()
Builds the instance of the POBAdResponse based on provided details.
- Returns:
Returns updated instance
-
setServerSidePartnerBids
POBAdResponse.Builder<T> setServerSidePartnerBids(List<T> serverSidePartnerBids)
Update the server-side Partner bids in the adResponse builder
- Parameters:
serverSidePartnerBids- server-side Partner bids to be update- Returns:
Returns updated instance
-
setWinningBid
POBAdResponse.Builder<T> setWinningBid(@Nullable() T winningBid)
Sets the winning bid
- Parameters:
winningBid- winning bid instance- Returns:
Returns updated instance
-
setNextHighestDynamicBid
@NonNull() POBAdResponse.Builder<T> setNextHighestDynamicBid(@Nullable() T nextHighestDynamicBid)
-
setRefreshInterval
POBAdResponse.Builder<T> setRefreshInterval(int refreshInterval)
Sets the refresh interval
- Parameters:
refreshInterval- refresh interval- Returns:
Returns updated instance
-
setNbrCode
POBAdResponse.Builder<T> setNbrCode(@Nullable() Integer nbrCode)
Sets the nbr code
- Parameters:
nbrCode- Code received in the ad response- Returns:
Returns updated instance
-
-
-
-