public static final class RadioMetadata.Builder extends Object
Constructor and Description |
---|
Builder()
Create an empty Builder.
|
Builder(RadioMetadata source)
Create a Builder using a
RadioMetadata instance to set the
initial values. |
Builder(RadioMetadata source,
int maxBitmapSize)
Create a Builder using a
RadioMetadata instance to set
initial values, but replace bitmaps with a scaled down copy if they
are larger than maxBitmapSize. |
Modifier and Type | Method and Description |
---|---|
RadioMetadata |
build()
Creates a
RadioMetadata instance with the specified fields. |
RadioMetadata.Builder |
putBitmap(String key,
Bitmap value)
Put a
Bitmap into the meta data. |
RadioMetadata.Builder |
putClock(String key,
long utcSecondsSinceEpoch,
int timezoneOffsetMinutes)
Put a
RadioMetadata.Clock into the meta data. |
RadioMetadata.Builder |
putInt(String key,
int value)
Put an int value into the meta data.
|
RadioMetadata.Builder |
putString(String key,
String value)
Put a String value into the meta data.
|
public Builder()
RadioMetadata
must be added.public Builder(RadioMetadata source)
RadioMetadata
instance to set the
initial values. All fields in the source meta data will be included in
the new meta data. Fields can be overwritten by adding the same key.source
- public Builder(RadioMetadata source, int maxBitmapSize)
RadioMetadata
instance to set
initial values, but replace bitmaps with a scaled down copy if they
are larger than maxBitmapSize.source
- The original meta data to copy.maxBitmapSize
- The maximum height/width for bitmaps contained
in the meta data.public RadioMetadata.Builder putString(String key, String value)
key
- The key for referencing this valuevalue
- The String value to storepublic RadioMetadata.Builder putInt(String key, int value)
key
- The key for referencing this valuevalue
- The int value to storepublic RadioMetadata.Builder putBitmap(String key, Bitmap value)
Bitmap
into the meta data. Custom keys may be used, but
if the METADATA_KEYs defined in this class are used they may only be
one of the following:
key
- The key for referencing this valuevalue
- The Bitmap to storepublic RadioMetadata.Builder putClock(String key, long utcSecondsSinceEpoch, int timezoneOffsetMinutes)
RadioMetadata.Clock
into the meta data. Custom keys may be used, but if the
METADATA_KEYs defined in this class are used they may only be one of the following:
#MEADATA_KEY_CLOCK
utcSecondsSinceEpoch
- Number of seconds since epoch for UTC + 0 timezone.timezoneOffsetInMinutes
- Offset of timezone from UTC + 0 in minutes.public RadioMetadata build()
RadioMetadata
instance with the specified fields.RadioMetadata
object