Package com.brightcove.player.model
Class MetadataObject
java.lang.Object
com.brightcove.player.model.MetadataObject
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CuePoint
,Playlist
,SourceAwareMetadataObject
,Video
Provides a common metadata collection for any data model objects using a generic, dynamic
set of metadata properties.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMetadataObject
(Map<String, Object> properties) Initializes a MetadataObject with the given metadata properties. -
Method Summary
Modifier and TypeMethodDescriptiongetIntegerProperty
(String propertyName) Convenience method to retrieve a property from the dynamic properties Map that is expected to be an Integer.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.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.Retrieves a Map of dynamic properties for this object.getStringProperty
(String propertyName) Convenience method to retrieve a property from the dynamic properties Map that is expected to be a String.static String
getStringProperty
(Map<String, Object> properties, String propertyName) Convenience static method to retrieve a property from a properties Map that is expected to be a String.toString()
-
Field Details
-
TAG
-
properties
-
-
Constructor Details
-
MetadataObject
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
Retrieves a Map of dynamic properties for this object.- Returns:
- a Map of dynamic properties
-
getStringProperty
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 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
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
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
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
-