Package com.brightcove.player.model
Class MetadataObject
- java.lang.Object
-
- com.brightcove.player.model.MetadataObject
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
CuePoint
,Playlist
,SourceAwareMetadataObject
,Video
public abstract class MetadataObject extends java.lang.Object implements java.io.Serializable
Provides a common metadata collection for any data model objects using a generic, dynamic set of metadata properties.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
properties
static java.lang.String
TAG
-
Constructor Summary
Constructors Constructor Description MetadataObject(java.util.Map<java.lang.String,java.lang.Object> properties)
Initializes a MetadataObject with the given metadata properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
getIntegerProperty(java.lang.String propertyName)
Convenience method to retrieve a property from the dynamic properties Map that is expected to be an Integer.static java.lang.Integer
getIntegerProperty(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String propertyName)
Convenience static method to retrieve a property from a properties Map that is expected to be an Integer.static java.lang.Long
getLongProperty(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String propertyName)
Convenience static method to retrieve a property from a properties Map that is expected to be an Integer.java.util.Map<java.lang.String,java.lang.Object>
getProperties()
Retrieves a Map of dynamic properties for this object.java.lang.String
getStringProperty(java.lang.String propertyName)
Convenience method to retrieve a property from the dynamic properties Map that is expected to be a String.static java.lang.String
getStringProperty(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String propertyName)
Convenience static method to retrieve a property from a properties Map that is expected to be a String.java.lang.String
toString()
-
-
-
Constructor Detail
-
MetadataObject
public MetadataObject(@NonNull java.util.Map<java.lang.String,java.lang.Object> properties)
Initializes a MetadataObject with the given metadata properties.- Parameters:
properties
- the metadata assigned to this instance- Throws:
java.lang.IllegalArgumentException
- if properties is null
-
-
Method Detail
-
getProperties
@NonNull public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Retrieves a Map of dynamic properties for this object.- Returns:
- a Map of dynamic properties
-
getStringProperty
public java.lang.String getStringProperty(java.lang.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 java.lang.String getStringProperty(@NonNull java.util.Map<java.lang.String,java.lang.Object> properties, @NonNull java.lang.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 objectpropertyName
- 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 java.lang.Integer getIntegerProperty(java.lang.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 java.lang.Integer getIntegerProperty(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.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 objectpropertyName
- 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 java.lang.Long getLongProperty(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.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 objectpropertyName
- 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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-