| java.lang.Object | |
| ↳ | fm.audiobox.core.utils.ModelUtil |
Handful util class for various models tasks.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | AUDIOBOX_DATE_FORMAT | ||||||||||
| String | ID_PLACEHOLDER | ||||||||||
| String | TOKEN_PLACEHOLDER | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ModelUtil() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static Playlist |
findPlaylistByType(List<Playlist> playlists, String type)
Given the user's playlists and the desired type this method will return the right playlist.
| ||||||||||
| static String |
interpolate(String url, long id)
Performs models urls interpolation with the
ID_PLACEHOLDER. | ||||||||||
| static String |
interpolate(String url, String token)
Performs models urls interpolation with the
TOKEN_PLACEHOLDER. | ||||||||||
| static long |
toUnixTime(SimpleDateFormat simpleDateFormat, String audioboxDate)
Given a string representing an UTC date provided by AudioBox server,
this method returns a unix timestamp (always in UTC).
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Given the user's playlists and the desired type this method will return the right playlist.
If the playlist is not found null is returned.
| playlists | the user's playlists |
|---|---|
| type | the Playlists#PLAYLIST_* type to find |
Performs models urls interpolation with the ID_PLACEHOLDER.
| url | the url |
|---|---|
| id | the id |
Performs models urls interpolation with the TOKEN_PLACEHOLDER.
| url | the url |
|---|---|
| token | the token |
Given a string representing an UTC date provided by AudioBox server, this method returns a unix timestamp (always in UTC).
| simpleDateFormat | the simple date format |
|---|---|
| audioboxDate | the string date provided by audiobox server. |
| ParseException | the parse exception |
|---|