Class MetadataObject

java.lang.Object
com.brightcove.player.model.MetadataObject
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CuePoint, Playlist, SourceAwareMetadataObject, Video

public abstract class MetadataObject extends Object implements Serializable
Provides a common metadata collection for any data model objects using a generic, dynamic set of metadata properties.
See Also:
  • Field Details

    • TAG

      public static final String TAG
    • properties

      @NonNull protected final Map<String,Object> properties
  • Constructor Details

    • MetadataObject

      public MetadataObject(@NonNull Map<String,Object> properties)
      Initializes a MetadataObject with the given metadata properties.
      Parameters:
      properties - the metadata assigned to this instance
      Throws:
      IllegalArgumentException - if properties is null
  • Method Details

    • getProperties

      @NonNull public Map<String,Object> getProperties()
      Retrieves a Map of dynamic properties for this object.
      Returns:
      a Map of dynamic properties
    • getStringProperty

      public String getStringProperty(String propertyName)
      Convenience method to retrieve a property from the dynamic properties Map that is expected to be a String.
      Parameters:
      propertyName - the Map key for the desired property
      Returns:
      the value of the property, or null if it cannot be found or is not a String
    • getStringProperty

      @Nullable public static String getStringProperty(@NonNull Map<String,Object> properties, @NonNull String propertyName)
      Convenience static method to retrieve a property from a properties Map that is expected to be a String.
      Parameters:
      properties - the properties Map object
      propertyName - the Map key for the desired property
      Returns:
      the value of the property, or null if it cannot be found or is not a String
    • getIntegerProperty

      public Integer getIntegerProperty(String propertyName)
      Convenience method to retrieve a property from the dynamic properties Map that is expected to be an Integer. Any parsing errors will yield a null response.
      Parameters:
      propertyName - the Map key for the desired property
      Returns:
      the value of the property, or null if it cannot be found or cannot be parsed to an Integer
    • getIntegerProperty

      public static Integer getIntegerProperty(Map<String,Object> properties, String propertyName)
      Convenience static method to retrieve a property from a properties Map that is expected to be an Integer. Any parsing errors will yield a null response.
      Parameters:
      properties - the properties Map object
      propertyName - the Map key for the desired property
      Returns:
      the value of the property, or null if it cannot be found or cannot be parsed to an Integer
    • getLongProperty

      public static Long getLongProperty(Map<String,Object> properties, String propertyName)
      Convenience static method to retrieve a property from a properties Map that is expected to be an Integer. Any parsing errors will yield a null response.
      Parameters:
      properties - the properties Map object
      propertyName - the Map key for the desired property
      Returns:
      the value of the property, or null if it cannot be found or cannot be parsed to an Integer
    • toString

      public String toString()
      Overrides:
      toString in class Object