Modifier and Type | Field and Description |
---|---|
static String |
albumCoverDescriptor |
static String |
albumCoverFormatDescriptor |
static String |
albumDescriptor |
static String |
artistDescriptor |
static String |
bmpDescriptor |
static String |
dataDescriptor |
static String |
durationDescriptor |
static String |
genreDescriptor |
static String |
nameDescriptor |
static String |
yearDescriptor |
Constructor and Description |
---|
TrackInfo(String name) |
TrackInfo(String name,
String artist,
String album) |
TrackInfo(String name,
String artist,
String album,
byte[] albumCover,
String albumCoverFormat) |
TrackInfo(String name,
String artist,
String album,
byte[] albumCover,
String albumCoverFormat,
String data) |
TrackInfo(String name,
String artist,
String album,
byte[] albumCover,
String albumCoverFormat,
String data,
String year,
String genre,
String bmp,
long duration) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
HashMap<String,Object> |
export()
exports the TrackInfo to a Hashmap
|
Optional<String> |
getAlbum()
returns a String containing the Name of the Album
|
Optional<byte[]> |
getAlbumCover()
returns the album cover as bytes, format specified by:
getAlbumCoverFormat() . |
Optional<String> |
getAlbumCoverFormat()
returns the format of the album cover, which can be obtained by calling
getAlbumCover() . |
Optional<String> |
getArtist()
returns a String containing the Name of the Artist
|
Optional<String> |
getBmp()
returns a String containing the BMP
|
Optional<String> |
getData()
returns the data of the TrackInfo.
|
Optional<Long> |
getDuration()
returns a long containing the Duration in milliseconds
|
Optional<String> |
getGenre()
returns a String containing the Genre
|
Optional<String> |
getName()
returns a String containing the Name of the Track
|
Optional<String> |
getYear()
returns a String containing the Year of the release
|
int |
hashCode() |
static Optional<TrackInfo> |
importFromHashMap(HashMap<String,Object> hashMap)
returns the optional TrackInfo if the HashMap contains no malformed data
|
static Optional<TrackInfo> |
importFromResource(ResourceModel resourceModel)
creates a TrackInfo from the resourceModel
|
boolean |
isNew(String name,
String artist,
String album,
byte[] albumCover,
String albumCoverFormat,
String id,
String year,
String genre,
String bmp,
long duration)
retruns true if any of these arguments is already existing and would be overwritten, otherwise retruns false.
|
boolean |
isNew(TrackInfo trackInfo)
retruns true if any of these arguments is already existing and would be overwritten, otherwise retruns false.
|
Optional<TrackInfo> |
update(String name,
String artist,
String album,
byte[] albumCover,
String coverFormat,
String data,
String year,
String genre,
String bmp,
long duration)
returns a trackinfo if some information was added and not overwritten (see isNew) AND a change occurred.
|
Optional<TrackInfo> |
update(TrackInfo trackInfo)
returns a trackinfo if some information was added and not overwritten
|
public static final String nameDescriptor
public static final String artistDescriptor
public static final String albumDescriptor
public static final String albumCoverDescriptor
public static final String albumCoverFormatDescriptor
public static final String dataDescriptor
public static final String yearDescriptor
public static final String genreDescriptor
public static final String bmpDescriptor
public static final String durationDescriptor
public TrackInfo(String name, String artist, String album, byte[] albumCover, String albumCoverFormat)
public TrackInfo(String name, String artist, String album, byte[] albumCover, String albumCoverFormat, String data)
public Optional<String> getName()
public Optional<String> getArtist()
public Optional<String> getAlbum()
public Optional<byte[]> getAlbumCover()
getAlbumCoverFormat()
.public Optional<String> getAlbumCoverFormat()
getAlbumCover()
.public Optional<String> getData()
this field is mostly internal, can be an url etc. should be used only if obtained from a player
public Optional<String> getYear()
public Optional<String> getGenre()
public Optional<String> getBmp()
public Optional<Long> getDuration()
public boolean isNew(TrackInfo trackInfo)
trackInfo
- the trackInfo to compare againstpublic boolean isNew(String name, String artist, String album, byte[] albumCover, String albumCoverFormat, String id, String year, String genre, String bmp, long duration)
name
- the nameartist
- the artistalbum
- the albumalbumCover
- the album coveralbumCoverFormat
- the album cover formatid
- the id of the trackyear
- the yeargenre
- the genreduration
- the durationbmp
- the bmppublic Optional<TrackInfo> update(TrackInfo trackInfo)
trackInfo
- the data to comparepublic Optional<TrackInfo> update(String name, String artist, String album, byte[] albumCover, String coverFormat, String data, String year, String genre, String bmp, long duration)
name
- the nameartist
- the artistalbum
- the albumalbumCover
- the album covercoverFormat
- the album cover formatdata
- the datayear
- the yeargenre
- the genreduration
- the durationbmp
- the bmppublic static Optional<TrackInfo> importFromHashMap(HashMap<String,Object> hashMap)
hashMap
- the data to import frompublic static Optional<TrackInfo> importFromResource(ResourceModel resourceModel)
resourceModel
- the resourceModelCopyright © 2016. All rights reserved.