com.brightcove.ssai.ad

## Class AdPod

- java.lang.Object
- - com.brightcove.ssai.ad.AdPod

-     public class AdPod
      extends java.lang.Object

  A representation of an Ad pod. An Ad pod is a sequenced group of Ads.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAdBreak(AdBreak adBreak)` Adds an Ad break.
    `static AdPod` | `create(long relativeStartPosition)` Creates an Ad pod with a empty list of `AdBreak`s.
    `static AdPod` | `create(long relativeStartPosition, java.util.Deque<AdBreak> adBreaks)` Creates an Ad pod with a given list of `AdBreak`s.
    `static AdPod` | `empty()` Creates an Ad pod with a empty list of `AdBreak`s.
    `long` | `getAbsoluteEndPosition()` Gets the absolute end position.
    `long` | `getAbsoluteStartPosition()` Gets the absolute start position.
    `Ad<?>` | `getAdAt(long absolutePosition)` Gets ad at a given absolute position.
    `AdBreak` | `getAdBreakAt(long absolutePosition)` Gets ad break at a given absolute position.
    `java.util.Collection<AdBreak>` | `getAdBreakList()` Gets the Ad break list.
    `long` | `getDuration()` Gets the total Ad pod duration.
    `long` | `getRelativeStartPosition()` Gets the relative start position.
    `boolean` | `isEmpty()` Returns `true` if this `AdPod` contains no `AdBreak`s.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### empty

          public static AdPod empty()

      Creates an Ad pod with a empty list of `AdBreak`s.
      Returns:
        the ad pod

    - #### isEmpty

          public boolean isEmpty()

      Returns `true` if this `AdPod` contains no `AdBreak`s.
      Returns:
        Returns `true` if this AdPod contains no AdBreaks

    - #### create

          public static AdPod create(long relativeStartPosition)

      Creates an Ad pod with a empty list of `AdBreak`s.
      Parameters:
        `relativeStartPosition` - the relative start position
      Returns:
        the ad pod

    - #### create

          public static AdPod create(long relativeStartPosition,
                                     @NonNull
                                     java.util.Deque<AdBreak> adBreaks)

      Creates an Ad pod with a given list of `AdBreak`s.
      Parameters:
        `relativeStartPosition` - the relative start position
        `adBreaks` - the ad breaks
      Returns:
        the ad pod

    - #### getAdBreakList

          public java.util.Collection<AdBreak> getAdBreakList()

      Gets the Ad break list.
      Returns:
        the ad break list

    - #### addAdBreak

          public void addAdBreak(AdBreak adBreak)

      Adds an Ad break.
      Parameters:
        `adBreak` - the ad break

    - #### getRelativeStartPosition

          public long getRelativeStartPosition()

      Gets the relative start position.
      Returns:
        the relative start position

    - #### getAbsoluteStartPosition

          public long getAbsoluteStartPosition()

      Gets the absolute start position.
      Returns:
        the start position

    - #### getAbsoluteEndPosition

          public long getAbsoluteEndPosition()

      Gets the absolute end position.
      Returns:
        the end position

    - #### getDuration

          public long getDuration()

      Gets the total Ad pod duration.
      Returns:
        the duration

    - #### getAdBreakAt

          @Nullable
          public AdBreak getAdBreakAt(long absolutePosition)

      Gets ad break at a given absolute position.
      Parameters:
        `absolutePosition` - the absolute position
      Returns:
        the ad break at

    - #### getAdAt

          @Nullable
          public Ad<?> getAdAt(long absolutePosition)

      Gets ad at a given absolute position.
      Parameters:
        `absolutePosition` - the absolute position
      Returns:
        the ad at given absolutePosition.