use of com.zype.android.webapi.model.playlist.PlaylistData in project zype-android by zype.
the class DbHelper method playlistDataToEntity.
public static List<Playlist> playlistDataToEntity(List<PlaylistData> playlists) {
List<Playlist> result = new ArrayList<>(playlists.size());
for (PlaylistData item : playlists) {
Playlist playlistEntity = new Playlist();
playlistEntity.id = item.getId();
playlistEntity.active = item.active ? 1 : 0;
playlistEntity.createdAt = item.getCreatedAt();
playlistEntity.deletedAt = item.getDeletedAt();
playlistEntity.images = new Gson().toJson(item.getImages());
playlistEntity.marketplaceIds = new Gson().toJson(item.marketplaceIds);
playlistEntity.purchasePrice = item.purchasePrice;
playlistEntity.purchaseRequired = item.purchaseRequired ? 1 : 0;
playlistEntity.parentId = item.getParentId();
playlistEntity.playlistItemCount = item.getPlaylistItemCount();
playlistEntity.priority = item.getPriority();
playlistEntity.thumbnails = new Gson().toJson(item.getThumbnails());
playlistEntity.thumbnailLayout = item.getThumbnailLayout();
playlistEntity.title = item.getTitle();
playlistEntity.updatedAt = item.getUpdatedAt();
result.add(playlistEntity);
}
return result;
}
Aggregations