com.brightcove.player.model

## Class SourceCollection

- java.lang.Object
- - com.brightcove.player.model.MetadataObject
  - - com.brightcove.player.model.SourceAwareMetadataObject
    - - com.brightcove.player.model.SourceCollection

- All Implemented Interfaces:
    java.io.Serializable

      public class SourceCollection
      extends SourceAwareMetadataObject

  The SourceCollection class represents a collection of video asset Source model objects grouped by a common encoding and/or delivery method. The delivery method is defined in the dynamic metadata properties.

  For example, one SourceCollection may contain several H.264-encoded asset URLs suitable for progressive download, each representing a different bit rate and resoultion, while another SourceCollection may contain a single HTTP Live Streaming (HLS) asset URL (with which the adaptation of bit rate is managed via the HLS protocol and not separate asset URLs).

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.brightcove.player.model.SourceAwareMetadataObject

      `SourceAwareMetadataObject.Fields`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SourceCollection` | `EMPTY` Indicates an empty Source Collection.

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

      `properties, TAG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SourceCollection(java.util.Map<java.lang.String,java.lang.Object> properties)`
    `SourceCollection(java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Set<Source> sources)` Initializes a new SourceCollection with a predefined metadata properties collection and a predefined Set of Source objects.
    `SourceCollection(java.util.Set<Source> sources, DeliveryType deliveryType)` Initializes a new SourceCollection with a predefined Set of Source objects all having the given DeliveryType.
    `SourceCollection(Source source, DeliveryType deliveryType)` Convenience constructor that initializes the SourceCollection with a single Source (most commonly used for HTTP Live Streaming which only has a single URL)

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Set<Source>` | `getSources()` Retrieves a collection of Source asset model objects in this SourceCollection.
    `java.lang.String` | `toString()`

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

      `getDeliveryType, initializeDeliveryType`

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

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

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

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

- - ### Field Detail

    - #### EMPTY

          public static final SourceCollection EMPTY

      Indicates an empty Source Collection. Use this instead of null.

  - ### Constructor Detail

    - #### SourceCollection

          public SourceCollection(@NonNull
                                  java.util.Map<java.lang.String,java.lang.Object> properties)

      See Also:
        `MetadataObject.MetadataObject(java.util.Map)`

    - #### SourceCollection

          public SourceCollection(@NonNull
                                  java.util.Map<java.lang.String,java.lang.Object> properties,
                                  @NonNull
                                  java.util.Set<Source> sources)

      Initializes a new SourceCollection with a predefined metadata properties collection and a predefined Set of Source objects.
      Parameters:
        `properties` - the metadata assigned to this instance
        `sources` - the video asset sources to associate with this SourceCollection

    - #### SourceCollection

          public SourceCollection(@NonNull
                                  java.util.Set<Source> sources,
                                  @NonNull
                                  DeliveryType deliveryType)

      Initializes a new SourceCollection with a predefined Set of Source objects all having the given DeliveryType. All Sources in a SourceCollection should be of the same DeliveryType.
      Parameters:
        `sources` - the video asset sources to associate with this SourceCollection
        `deliveryType` - the DeliveryType format for all the given Sources

    - #### SourceCollection

          public SourceCollection(@NonNull
                                  Source source,
                                  @NonNull
                                  DeliveryType deliveryType)

      Convenience constructor that initializes the SourceCollection with a single Source (most commonly used for HTTP Live Streaming which only has a single URL)
      Parameters:
        `source` - the single Source for this collection
        `deliveryType` - the DeliveryType format for all the given Sources

  - ### Method Detail

    - #### getSources

          @NonNull
          public java.util.Set<Source> getSources()

      Retrieves a collection of Source asset model objects in this SourceCollection.
      Returns:
        the collection of video asset sources

    - #### toString

          @NonNull
          public java.lang.String toString()

      Overrides:
        `toString` in class `MetadataObject`