@Test public void identifyAdType() { String adType = BidMachineFetcher.identifyAdType(null); assertNull(adType); adType = BidMachineFetcher.identifyAdType(CreativeFormat.Banner); assertEquals("display", adType); adType = BidMachineFetcher.identifyAdType(CreativeFormat.Video); assertEquals("video", adType); adType = BidMachineFetcher.identifyAdType(CreativeFormat.Native); assertEquals("native", adType); }
@Nullable @VisibleForTesting static String identifyAdType(@Nullable CreativeFormat creativeFormat) { if (creativeFormat == null) { return null; } switch (creativeFormat) { case Banner: return AD_TYPE_DISPLAY; case Video: return AD_TYPE_VIDEO; case Native: return AD_TYPE_NATIVE; default: return null; } }
BidMachineFetcher { @Nullable @VisibleForTesting static String identifyAdType(@Nullable CreativeFormat creativeFormat) { if (creativeFormat == null) { return null; } switch (creativeFormat) { case Banner: return AD_TYPE_DISPLAY; case Video: return AD_TYPE_VIDEO; case Native: return AD_TYPE_NATIVE; default: return null; } } }
BidMachineFetcher { @Nullable @VisibleForTesting static String identifyAdType(@Nullable CreativeFormat creativeFormat) { if (creativeFormat == null) { return null; } switch (creativeFormat) { case Banner: return AD_TYPE_DISPLAY; case Video: return AD_TYPE_VIDEO; case Native: return AD_TYPE_NATIVE; default: return null; } }  }
BidMachineFetcher { @Nullable @VisibleForTesting static String identifyAdType(@Nullable CreativeFormat creativeFormat) { if (creativeFormat == null) { return null; } switch (creativeFormat) { case Banner: return AD_TYPE_DISPLAY; case Video: return AD_TYPE_VIDEO; case Native: return AD_TYPE_NATIVE; default: return null; } }  static void setPriceRounding(double rounding); static void setPriceRounding(double rounding, RoundingMode roundingMode); @Nullable @SuppressWarnings({"unchecked"}) static Map<String, String> fetch(@NonNull AdRequest adRequest); @Nullable static T release(@NonNull T adRequest); @Nullable static T release(@NonNull AdsType adsType,
                                                  @NonNull Map<String, String> fetchedParams); @Nullable @SuppressWarnings("unchecked") static T release(@NonNull AdsType adsType,
                                                  @Nullable String requestId); static String roundPrice(double price); static void resetPriceRounding(); }
BidMachineFetcher { @Nullable @VisibleForTesting static String identifyAdType(@Nullable CreativeFormat creativeFormat) { if (creativeFormat == null) { return null; } switch (creativeFormat) { case Banner: return AD_TYPE_DISPLAY; case Video: return AD_TYPE_VIDEO; case Native: return AD_TYPE_NATIVE; default: return null; } }  static void setPriceRounding(double rounding); static void setPriceRounding(double rounding, RoundingMode roundingMode); @Nullable @SuppressWarnings({"unchecked"}) static Map<String, String> fetch(@NonNull AdRequest adRequest); @Nullable static T release(@NonNull T adRequest); @Nullable static T release(@NonNull AdsType adsType,
                                                  @NonNull Map<String, String> fetchedParams); @Nullable @SuppressWarnings("unchecked") static T release(@NonNull AdsType adsType,
                                                  @Nullable String requestId); static String roundPrice(double price); static void resetPriceRounding(); static final String KEY_ID; static final String KEY_PRICE; static final String KEY_AD_TYPE; static final String KEY_NETWORK_KEY; static final String AD_TYPE_DISPLAY; static final String AD_TYPE_VIDEO; static final String AD_TYPE_NATIVE; }