@Test public void identifyCreativeFormat_containsEmptyDisplay_creativeFormatIsNull() { Ad.Display display = Ad.Display.newBuilder() .build(); Ad ad = Ad.newBuilder() .setDisplay(display) .build(); CreativeFormat creativeFormat = AuctionResultImpl.identifyCreativeFormat(ad); assertNull(creativeFormat); }
@Nullable @VisibleForTesting static CreativeFormat identifyCreativeFormat(@NonNull Ad ad) { if (ad.hasDisplay()) { Ad.Display display = ad.getDisplay(); if (display.hasBanner() || !TextUtils.isEmpty(display.getAdm())) { return CreativeFormat.Banner; } else if (display.hasNative()) { return CreativeFormat.Native; } } else if (ad.hasVideo()) { return CreativeFormat.Video; } return null; }
AuctionResultImpl implements AuctionResult { @Nullable @VisibleForTesting static CreativeFormat identifyCreativeFormat(@NonNull Ad ad) { if (ad.hasDisplay()) { Ad.Display display = ad.getDisplay(); if (display.hasBanner() || !TextUtils.isEmpty(display.getAdm())) { return CreativeFormat.Banner; } else if (display.hasNative()) { return CreativeFormat.Native; } } else if (ad.hasVideo()) { return CreativeFormat.Video; } return null; } }
AuctionResultImpl implements AuctionResult { @Nullable @VisibleForTesting static CreativeFormat identifyCreativeFormat(@NonNull Ad ad) { if (ad.hasDisplay()) { Ad.Display display = ad.getDisplay(); if (display.hasBanner() || !TextUtils.isEmpty(display.getAdm())) { return CreativeFormat.Banner; } else if (display.hasNative()) { return CreativeFormat.Native; } } else if (ad.hasVideo()) { return CreativeFormat.Video; } return null; } AuctionResultImpl(@NonNull Response.Seatbid seatbid,
                      @NonNull Response.Seatbid.Bid bid,
                      @NonNull Ad ad,
                      @NonNull NetworkConfig networkConfig); }
AuctionResultImpl implements AuctionResult { @Nullable @VisibleForTesting static CreativeFormat identifyCreativeFormat(@NonNull Ad ad) { if (ad.hasDisplay()) { Ad.Display display = ad.getDisplay(); if (display.hasBanner() || !TextUtils.isEmpty(display.getAdm())) { return CreativeFormat.Banner; } else if (display.hasNative()) { return CreativeFormat.Native; } } else if (ad.hasVideo()) { return CreativeFormat.Video; } return null; } AuctionResultImpl(@NonNull Response.Seatbid seatbid,
                      @NonNull Response.Seatbid.Bid bid,
                      @NonNull Ad ad,
                      @NonNull NetworkConfig networkConfig); @NonNull @Override String getId(); @Nullable @Override String getDemandSource(); @Override double getPrice(); @Nullable @Override String getDeal(); @Override @Nullable String getSeat(); @Override @NonNull String getCreativeId(); @Nullable @Override String getCid(); @Override @Nullable String[] getAdDomains(); @Override @NonNull String getNetworkKey(); @Nullable @Override CreativeFormat getCreativeFormat(); @NonNull @Override Map<String, String> getCustomParams(); @NonNull @Override String toString(); }
AuctionResultImpl implements AuctionResult { @Nullable @VisibleForTesting static CreativeFormat identifyCreativeFormat(@NonNull Ad ad) { if (ad.hasDisplay()) { Ad.Display display = ad.getDisplay(); if (display.hasBanner() || !TextUtils.isEmpty(display.getAdm())) { return CreativeFormat.Banner; } else if (display.hasNative()) { return CreativeFormat.Native; } } else if (ad.hasVideo()) { return CreativeFormat.Video; } return null; } AuctionResultImpl(@NonNull Response.Seatbid seatbid,
                      @NonNull Response.Seatbid.Bid bid,
                      @NonNull Ad ad,
                      @NonNull NetworkConfig networkConfig); @NonNull @Override String getId(); @Nullable @Override String getDemandSource(); @Override double getPrice(); @Nullable @Override String getDeal(); @Override @Nullable String getSeat(); @Override @NonNull String getCreativeId(); @Nullable @Override String getCid(); @Override @Nullable String[] getAdDomains(); @Override @NonNull String getNetworkKey(); @Nullable @Override CreativeFormat getCreativeFormat(); @NonNull @Override Map<String, String> getCustomParams(); @NonNull @Override String toString();  }