com.brightcove.player.model

## Class CuePoint

- java.lang.Object
- - com.brightcove.player.model.MetadataObject
  - - com.brightcove.player.model.CuePoint

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CuePoint>

      public class CuePoint
      extends MetadataObject
      implements java.lang.Comparable<CuePoint>

  Represents the data of a single cue point.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CuePoint.CuePointType` Specifies the cue point type.
    `static class` | `CuePoint.PositionType` Indicates the position of the cue point in relation to the entire video.

  - ### Field Summary

    - ### Fields inherited from class com.brightcove.player.model.MetadataObject

      `properties, TAG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CuePoint(CuePoint.PositionType positionType, CuePoint.CuePointType type, java.util.Map<java.lang.String,java.lang.Object> properties)` Used to create a pre-roll (PositionType.BEFORE) or post-roll (PositionType.AFTER) cue point.
    `CuePoint(CuePoint.PositionType positionType, java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> properties)` Deprecated. Use the construtor that use a CuePointType rather than a string. This will guarantee that the CuePoint is of a known type and can be handled properly by the system. This method now throws IllegalArgumentException if the string value describing the cue point type does not specify a known cue point type. Currently supported values are "AD" or "CODE".
    `CuePoint(int position, CuePoint.CuePointType type, java.util.Map<java.lang.String,java.lang.Object> properties)` Deprecated.
    `CuePoint(int position, java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> properties)` Deprecated. Use the construtor that takes a CuePointType rather than a string. This will guarantee that the CuePoint is of a known type and can be handled properly by the system. This method now throws IllegalArgumentException if the string value describing the cue point type does not specify a known cue point type. Currently supported values are "AD" and "CODE".
    `CuePoint(long position, CuePoint.CuePointType type, java.util.Map<java.lang.String,java.lang.Object> properties)` Used to create a mid-roll (PositionType.POINT_IN_TIME) cue point at a specific position.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(CuePoint cuePoint)` Compares this CuePoint object with the specified CuePoint object.
    `boolean` | `equals(java.lang.Object object)`
    `CuePoint.CuePointType` | `getCuePointType()`
    `int` | `getPosition()` Deprecated.
    `long` | `getPositionLong()` Returns the time offset of the cue point from the beginning of the video, in milliseconds.
    `CuePoint.PositionType` | `getPositionType()`
    `java.lang.String` | `getType()` Deprecated. Use getPositionType()
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class com.brightcove.player.model.MetadataObject

      `getIntegerProperty, getIntegerProperty, getLongProperty, getProperties, getStringProperty, getStringProperty`

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

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

- - ### Constructor Detail

    - #### CuePoint

          @Deprecated
          public CuePoint(CuePoint.PositionType positionType,
                                      @NonNull
                                      java.lang.String type,
                                      java.util.Map<java.lang.String,java.lang.Object> properties)

      Deprecated. Use the construtor that use a CuePointType rather than a string. This will guarantee that the CuePoint is of a known type and can be handled properly by the system. This method now throws IllegalArgumentException if the string value describing the cue point type does not specify a known cue point type. Currently supported values are "AD" or "CODE".
      Used to create a before (pre-roll) or after (post-roll) cue point.
      Parameters:
        `positionType` - Either PositionType.Before (pre-roll) or PositionType.After (post-roll).
        `type` - The type of the cue point. Valid values are: "AD" or "CODE".
        `properties` - The properties describing this cue point.

    - #### CuePoint

          public CuePoint(@NonNull
                          CuePoint.PositionType positionType,
                          @NonNull
                          CuePoint.CuePointType type,
                          java.util.Map<java.lang.String,java.lang.Object> properties)

      Used to create a pre-roll (PositionType.BEFORE) or post-roll (PositionType.AFTER) cue point.
      Parameters:
        `positionType` - Either `CuePoint.PositionType.BEFORE` (pre-roll) or `CuePoint.PositionType.AFTER` (post-roll).
        `type` - Either `CuePoint.CuePointType.AD` or `CuePoint.CuePointType.CODE`
        `properties` - The properties describing this cue point.

    - #### CuePoint

          @Deprecated
          public CuePoint(int position,
                                      @NonNull
                                      java.lang.String type,
                                      java.util.Map<java.lang.String,java.lang.Object> properties)

      Deprecated. Use the construtor that takes a CuePointType rather than a string. This will guarantee that the CuePoint is of a known type and can be handled properly by the system. This method now throws IllegalArgumentException if the string value describing the cue point type does not specify a known cue point type. Currently supported values are "AD" and "CODE".
      Used to create a point in time (mid-roll) cue point at a specific position.
      Parameters:
        `position` - The offset from the beginning of the video, in milliseconds.
        `type` - The type of the cue point. Valid values are "AD" or "CODE".
        `properties` - The properties describing this cue point.

    - #### CuePoint

          @Deprecated
          public CuePoint(int position,
                                      @NonNull
                                      CuePoint.CuePointType type,
                                      java.util.Map<java.lang.String,java.lang.Object> properties)

      Deprecated.
      Used to create a mid-roll (PositionType.POINT_IN_TIME) cue point at a specific position.
      Parameters:
        `position` - The offset from the beginning of the video, in milliseconds.
        `type` - Either CuePointType.AD or CuePointType.CODE
        `properties` - The properties describing this cue point.

    - #### CuePoint

          public CuePoint(long position,
                          @NonNull
                          CuePoint.CuePointType type,
                          java.util.Map<java.lang.String,java.lang.Object> properties)

      Used to create a mid-roll (PositionType.POINT_IN_TIME) cue point at a specific position.
      Parameters:
        `position` - The offset from the beginning of the video, in milliseconds.
        `type` - Either CuePointType.AD or CuePointType.CODE
        `properties` - The properties describing this cue point.

  - ### Method Detail

    - #### getPositionType

          public CuePoint.PositionType getPositionType()

      Returns:
        The CuePoint.PositionType of this cue point.

    - #### getPosition

          @Deprecated
          public int getPosition()

      Deprecated.
      Returns the time offset of the cue point from the beginning of the video, in milliseconds.

      Note that this is only valid for PositionType.POINT_IN_TIME cue points.

      Returns:
        The position of the cue point as the number of milliseconds from the start of the video.
      Throws:
        `java.lang.IllegalStateException` - if you call this method on any CuePoint instance whose position type is not PositionType.POINT_IN_TIME.

    - #### getPositionLong

          public long getPositionLong()

      Returns the time offset of the cue point from the beginning of the video, in milliseconds.

      Note that this is only valid for PositionType.POINT_IN_TIME cue points.

      Returns:
        The position of the cue point as the number of milliseconds from the start of the video.
      Throws:
        `java.lang.IllegalStateException` - if you call this method on any CuePoint instance whose position type is not PositionType.POINT_IN_TIME.

    - #### getType

          @Deprecated
          public java.lang.String getType()

      Deprecated. Use getPositionType()
      Returns:
        A string representation of the CuePointType of this cue point.

    - #### getCuePointType

          public CuePoint.CuePointType getCuePointType()

      Returns:
        The CuePointType of this cue point.

    - #### compareTo

          public int compareTo(CuePoint cuePoint)

      Compares this CuePoint object with the specified CuePoint object.

      For all CuePoints:
      CuePoint.PositionType.BEFORE < CuePoint.PositionType.POINT_IN_TIME < CuePoint.PositionType.AFTER

      When both cue points being compared are PositionType.POINT_IN_TIME, then this < cuePoint if this.position < cuePoint.position.

      Specified by:
        `compareTo` in interface `java.lang.Comparable<CuePoint>`
      Parameters:
        `cuePoint` - The CuePoint to compare to this CuePoint.
      Returns:
        -1 if this CuePoint is earlier in the timeline than the specified CuePoint; 0 if the two CuePoints are at the same time; 1 if this CuePoint is later in the timeline than the specified CuePoint.

    - #### equals

          public boolean equals(java.lang.Object object)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `MetadataObject`