# Enum AdFormat

java.lang.Object
java.lang.Enum<AdFormat>
com.codename1.ads.AdFormat

All Implemented Interfaces:
  `Comparable<AdFormat>`

public enum AdFormat extends Enum<AdFormat>
The ad formats supported by the modern advertising API. Not every `AdProvider` supports every format; query `AdManager.isSupported(AdFormat)` before requesting one.

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `APP_OPEN`
  A full screen ad shown when the application is brought to the foreground.
  `BANNER`
  A small rectangular ad that lives inside the component hierarchy.
  `INTERSTITIAL`
  A full screen ad shown at a natural break (e.g. between game levels).
  `NATIVE`
  An ad whose assets are rendered by the application using its own components.
  `REWARDED`
  An opt-in full screen ad that grants the user a reward for watching.
  `REWARDED_INTERSTITIAL`
  A full screen ad shown on a transition that may grant a reward but is not strictly opt-in.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static AdFormat`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static AdFormat[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### BANNER

    public static final AdFormat BANNER
    A small rectangular ad that lives inside the component hierarchy. See `BannerAd`.

  - ### INTERSTITIAL

    public static final AdFormat INTERSTITIAL
    A full screen ad shown at a natural break (e.g. between game levels). See `InterstitialAd`.

  - ### REWARDED

    public static final AdFormat REWARDED
    An opt-in full screen ad that grants the user a reward for watching. See `RewardedAd`.

  - ### REWARDED_INTERSTITIAL

    public static final AdFormat REWARDED_INTERSTITIAL
    A full screen ad shown on a transition that may grant a reward but is not strictly opt-in. See `RewardedInterstitialAd`.

  - ### APP_OPEN

    public static final AdFormat APP_OPEN
    A full screen ad shown when the application is brought to the foreground. See `AppOpenAd`.

  - ### NATIVE

    public static final AdFormat NATIVE
    An ad whose assets are rendered by the application using its own components. See `NativeAd`.

- ## Method Details

  - ### values

    public static AdFormat[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static AdFormat valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null