AI-generated Key Takeaways
-
The
MediaMetadataModifierclass is used to modify theMediaMetadataof the media info in media status. -
You can construct an instance of
MediaMetadataModifierusing its public constructor. -
The class provides methods to get and set overrides for various data types like date, double, int, string, time, images, and media type.
-
You can clear all current overrides using the
clear()method or remove a specific override usingremoveOverride(). -
The
hasOverrideForKey()method allows you to check if an override exists for a given key.
The class to modify the MediaMetadata
of the media info in media status.
Public Constructor Summary
|
MediaMetadataModifier()
Constructs an instance of
MediaMetadataModifier.
|
Public Method Summary
| void |
clear()
Clears all overrides.
|
| Calendar | |
| Double | |
| List<WebImage> |
getImages()
Returns the list of images to override.
|
| Integer | |
| Integer |
getMediaType()
Returns the media type to override.
|
| String | |
| Long | |
| boolean | |
| MediaMetadataModifier | |
| MediaMetadataModifier | |
| MediaMetadataModifier | |
| MediaMetadataModifier | |
| MediaMetadataModifier |
putTimeMillis(String key,
Long value)
Specifies a value to override in a time field, as a
long in
milliseconds.
|
| MediaMetadataModifier |
removeOverride(String key)
Remove the override of the given key, so that the SDK uses the default value
auto-generated from
MediaMetadataCompat.
|
| MediaMetadataModifier | |
| MediaMetadataModifier |
Inherited Method Summary
Public Constructors
public MediaMetadataModifier ()
Constructs an instance of MediaMetadataModifier.
Public Methods
public void clear ()
Clears all overrides.
public Calendar getDate (String key)
Returns the date override on a given key.
Parameters
| key | the key for the field |
|---|
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a date field. |
|---|---|
| NullPointerException | if there is no override for the key. |
public Double getDouble (String key)
Returns the double override on a given key.
Parameters
| key | the key for the field |
|---|
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a double field. |
|---|---|
| NullPointerException | if there is no override for the key. |
public Integer getInt (String key)
Returns the int override on a given key.
Parameters
| key | the key for the field |
|---|
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a int field. |
|---|---|
| NullPointerException | if there is no override for the key. |
public Integer getMediaType ()
Returns the media type to override.
public String getString (String key)
Returns the string override on a given key.
Parameters
| key | the key for the field |
|---|
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a String field. |
|---|---|
| NullPointerException | if there is no override for the key. |
public Long getTimeMillis (String key)
Returns the time override on a given key.
Parameters
| key | the key for the field |
|---|
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a time field. |
|---|---|
| NullPointerException | if there is no override for the key. |
public boolean hasOverrideForKey (String key)
Returns whether the metadata has override on a given key.
public MediaMetadataModifier putDate (String key, Calendar value)
Specifies a value to override in a date field.
Parameters
| key | the key for the field |
|---|---|
| value | the new value for the field. If null, the auto-generated value
from
MediaMetadataCompat |
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a date field. |
|---|
public MediaMetadataModifier putDouble (String key, Double value)
Specifies a value to override in a double field.
Parameters
| key | the key for the field |
|---|---|
| value | the new value for the field. If null, the auto-generated value
from
MediaMetadataCompat |
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a double field. |
|---|
public MediaMetadataModifier putInt (String key, Integer value)
Specifies a value to override in a int field.
Parameters
| key | the key for the field |
|---|---|
| value | the new value for the field. If null, the auto-generated value
from
MediaMetadataCompat |
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a int field. |
|---|
public MediaMetadataModifier putString (String key, String value)
Specifies a value to override in a String field.
Parameters
| key | the key for the field |
|---|---|
| value | the new value for the field. If null, the auto-generated value
from
MediaMetadataCompat |
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a String field. |
|---|
public MediaMetadataModifier putTimeMillis (String key, Long value)
Specifies a value to override in a time field, as a long in
milliseconds.
Parameters
| key | the key for the field |
|---|---|
| value | the new value for the field. If null, the auto-generated value
from
MediaMetadataCompat |
Throws
| IllegalArgumentException | if the key is null or empty or refers to a predefined field which
is not a time field. |
|---|
public MediaMetadataModifier removeOverride (String key)
Remove the override of the given key, so that the SDK uses the default value
auto-generated from MediaMetadataCompat.
public MediaMetadataModifier setImages (List<WebImage> images)
Specifies the list of images to override. If set to null, the
auto-generated value from
MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON_URI will be used.
public MediaMetadataModifier setMediaType (Integer mediaType)
Sets the media type to override.
The value must be one of the MEDIA_TYPE* constants of MediaMetadata,
or a value greater than or equal to MediaMetadata.MEDIA_TYPE_USER
for custom media types. Set to null to disable override.