com.brightcove.ssai.ad

## Interface Ad<T>

-     public interface Ad<T>

  Definition of an SSAI Ad.

  An Ad can be composed by any type of `CreativeType`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Ad.Category` The category of the Ad
    `static class` | `Ad.TrackingType` Tracking types supported by an Ad.
    `static class` | `Ad.Type` Types of Ads.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `AD_NON_SKIPPABLE_OFFSET_VALUE` The default skip offset value returned when the Ad is not skippable.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getAbsoluteEndPosition()`
    `long` | `getAbsoluteStartPosition()`
    `default Ad.Category` | `getCategory()` Gets the `Ad.Category` of this Ad.
    `int` | `getCompanionCount()`
    `CreativeClicks` | `getCreativeClicks()`
    `java.util.List<TrackingEvent>` | `getCreativeTrackingEvents(TrackingType trackingType, Ad.Type adType)`
    `long` | `getDuration()`
    `java.lang.String` | `getId()`
    `T` | `getRawAd()`
    `T` | `getRawCompanion()`
    `T` | `getRawCreative()`
    `long` | `getSkipOffset()` Returns the skip offset of the main ad.
    `java.lang.String` | `getTitle()`
    `java.util.List<TrackingEvent>` | `getTrackingEvents(Ad.TrackingType trackingType)`
    `boolean` | `hasCompanions()`
    `boolean` | `isLinear()`

- - ### Field Detail

    - #### AD_NON_SKIPPABLE_OFFSET_VALUE

          static final long AD_NON_SKIPPABLE_OFFSET_VALUE

      The default skip offset value returned when the Ad is not skippable.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getAbsoluteStartPosition

          long getAbsoluteStartPosition()

      Returns:
        the absoluteStartPosition of the ad.

    - #### getAbsoluteEndPosition

          long getAbsoluteEndPosition()

      Returns:
        the absoluteEndPosition of the ad.

    - #### getDuration

          long getDuration()

      Returns:
        the duration of the ad.

    - #### getId

          @NonNull
          java.lang.String getId()

      Returns:
        the id of the ad.

    - #### getTitle

          @NonNull
          java.lang.String getTitle()

      Returns:
        the title of the ad.

    - #### isLinear

          boolean isLinear()

      Returns:
        whether the ad type is linear.

    - #### hasCompanions

          boolean hasCompanions()

      Returns:
        whether the ad has companions.

    - #### getSkipOffset

          long getSkipOffset()

      Returns the skip offset of the main ad. It must return `AD_NON_SKIPPABLE_OFFSET_VALUE` when the Ad is not skippable.
      Returns:
        the skip offset of the main ad.

    - #### getTrackingEvents

          @NonNull
          java.util.List<TrackingEvent> getTrackingEvents(Ad.TrackingType trackingType)

      Parameters:
        `trackingType` - of the tracking events to be returned.
      Returns:
        a list of tracking events for the specified trackingType.

    - #### getCreativeTrackingEvents

          @NonNull
          java.util.List<TrackingEvent> getCreativeTrackingEvents(@NonNull
                                                                           TrackingType trackingType,
                                                                           @NonNull
                                                                           Ad.Type adType)

      Parameters:
        `trackingType` - `TrackingType` of the Tracking events to retrieve.
        `adType` - the `Ad.Type` of the creatives to retrieve the tracking events.
      Returns:
        the list of TrackingEvents for the given trackingType and adType.

    - #### getCompanionCount

          int getCompanionCount()

      Returns:
        number of companion ads in this ad.

    - #### getCreativeClicks

          @Nullable
          CreativeClicks getCreativeClicks()

      Returns:
        CreativeClicks of the main creative.

    - #### getRawAd

          @NonNull
          T getRawAd()

      Returns:
        the raw Object from the VAST processing library of the AD.

    - #### getRawCreative

          @NonNull
          T getRawCreative()

      Returns:
        the raw Object from the VAST processing library of the main Creative.

    - #### getRawCompanion

          @Nullable
          T getRawCompanion()

      Returns:
        the raw Object from the VAST processing library of the Companion Creative.

    - #### getCategory

          @NonNull
          default Ad.Category getCategory()

      Gets the `Ad.Category` of this Ad.
      Returns:
        the category