public final class MusicItem extends Schema<MusicItem>
This schema is used to create indexes for music items.
It supports index fields album, genre, artist,
duration, size, and all the fields in CommonItem.
Among these fields, identifier is mandatory and can be set via the
CommonItem#setIdentifier(String) method.
SystemCapability.Data#DATA_SEARCH| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static String |
ALBUM |
Indicates the index field name of
album. |
static String |
ARTIST |
Indicates the index field name of
artist. |
static String |
DURATION |
Indicates the index field name of
duration. |
static String |
GENRE |
Indicates the index field name of
genre. |
static String |
SIZE |
Indicates the index field name of
size. |
| 构造器 | 说明 |
|---|---|
MusicItem() |
A constructor used to create a
MusicItem instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getAlbum() |
Obtains the value of the
album index field. |
String |
getArtist() |
Obtains the value of the
artist index field. |
Integer |
getDuration() |
Obtains the value of the
duration index field. |
String |
getGenre() |
Obtains the value of the
genre index field. |
static List<IndexForm> |
getMusicSchema() |
Obtains a list of index field attributes in this
MusicItem object. |
Integer |
getSize() |
Obtains the value of the
size index field. |
MusicItem |
setAlbum(String album) |
Sets the
album index field. |
MusicItem |
setArtist(String artist) |
Sets the
artist index field. |
MusicItem |
setDuration(Integer duration) |
Sets the
duration index field. |
MusicItem |
setGenre(String genre) |
Sets the
genre index field. |
MusicItem |
setSize(Integer size) |
Sets the
size index field. |
clear, get, getAsDouble, getAsFloat, getAsInteger, getAsLong, getAsString, getValues, isEmpty, put, put, put, put, put, remove, setValues, sizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAlternateName, getCategory, getDateCreate, getDescription, getIdentifier, getKeywords, getName, getPotentialAction, getReserved1, getReserved2, getSubtitle, getThumbnailUrl, getTitle, getUrl, setAlternateName, setCategory, setDateCreate, setDescription, setIdentifier, setKeywords, setName, setPotentialAction, setReserved1, setReserved2, setSubtitle, setThumbnailUrl, setTitle, setUrlpublic static final String ALBUM
album.public static final String ARTIST
artist.public static final String DURATION
duration.public static final String GENRE
genre.public static List<IndexForm> getMusicSchema()
MusicItem object.public MusicItem setArtist(String artist)
artist index field.
Attributes of this index field:
IndexForm.indexFieldName = "artist";
IndexForm.indexType = IndexType.SORTED;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = true;
artist - Indicates the artist who plays the music.MusicItem object.public MusicItem setGenre(String genre)
genre index field.
Attributes of this index field:
IndexForm.indexFieldName = "genre";
IndexForm.indexType = IndexType.SORTED;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = true;
genre - Indicates the music genre.MusicItem object.public MusicItem setDuration(Integer duration)
duration index field.
Attributes of this index field:
IndexForm.indexFieldName = "duration";
IndexForm.indexType = IndexType.NO;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = false;
duration - Indicates the music duration in seconds.MusicItem object.public MusicItem setAlbum(String album)
album index field.
Attributes of this index field:
IndexForm.indexFieldName = "album";
IndexForm.indexType = IndexType.SORTED;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = true;
album - Indicates the album to which the music belongs.MusicItem object.public MusicItem setSize(Integer size)
size index field.
Attributes of this index field:
IndexForm.indexFieldName = "size";
IndexForm.indexType = IndexType.NO;
IndexForm.isPrimaryKey = false;
IndexForm.isStore = true;
IndexForm.isSearch = false;
size - Indicates the music file size.MusicItem object.public Integer getDuration()
duration index field.duration index field.public String getArtist()
artist index field.artist index field.public String getGenre()
genre index field.genre index field.public String getAlbum()
album index field.album index field.public Integer getSize()
size index field.size index field.