public class ModelUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AUDIOBOX_DATE_FORMAT |
static java.lang.String |
ID_PLACEHOLDER |
static java.lang.String |
TOKEN_PLACEHOLDER |
| Constructor and Description |
|---|
ModelUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Playlist |
findPlaylistByType(java.util.List<Playlist> playlists,
java.lang.String type)
Given the user's playlists and the desired type this method will return the right playlist.
|
static java.lang.String |
interpolate(java.lang.String url,
long id)
Performs models urls interpolation with the
ID_PLACEHOLDER. |
static java.lang.String |
interpolate(java.lang.String url,
java.lang.String token)
Performs models urls interpolation with the
TOKEN_PLACEHOLDER. |
static long |
toUnixTime(java.text.SimpleDateFormat simpleDateFormat,
java.lang.String audioboxDate)
Given a string representing an UTC date provided by AudioBox server,
this method returns a unix timestamp (always in UTC).
|
public static final java.lang.String TOKEN_PLACEHOLDER
public static final java.lang.String ID_PLACEHOLDER
public static final java.lang.String AUDIOBOX_DATE_FORMAT
public static java.lang.String interpolate(java.lang.String url,
java.lang.String token)
TOKEN_PLACEHOLDER.url - the urltoken - the tokenpublic static java.lang.String interpolate(java.lang.String url,
long id)
ID_PLACEHOLDER.url - the urlid - the idpublic static long toUnixTime(java.text.SimpleDateFormat simpleDateFormat,
java.lang.String audioboxDate)
throws java.text.ParseException
simpleDateFormat - the simple date formataudioboxDate - the string date provided by audiobox server.java.text.ParseException - the parse exceptionpublic static Playlist findPlaylistByType(java.util.List<Playlist> playlists, java.lang.String type)
playlists - the user's playliststype - the Playlists#PLAYLIST_* type to find