class PlayerLogic {

	public PlaylistEntity playPlaylist(int playlistNumber, SearchTypes type) {
		PlaylistEntity selectedPlaylist = null;
		if (type.equals(SearchTypes.FEATURED_PLAYLISTS) && this.search.getFeaturedPlaylists().size() > playlistNumber) {
			selectedPlaylist = this.search.getFeaturedPlaylists().get(playlistNumber);
		} else if (type.equals(SearchTypes.USER_PLAYLISTS) && this.search.getOwnPlaylists().size() > playlistNumber) {
			selectedPlaylist = this.search.getOwnPlaylists().get(playlistNumber);
		} else if (type.equals(SearchTypes.SEARCH_PLAYLISTS)
				&& this.search.getPlaylistSearchResults().size() > playlistNumber) {
			selectedPlaylist = this.search.getPlaylistSearchResults().get(playlistNumber);
		}
		if (selectedPlaylist != null) {
			if (this.suppressed) {
				this.postSuppressionAction = PostSuppressionAction.PLAY_COLLECTION;
				this.collectionUriToPlay = selectedPlaylist.getUri();
			} else {
				this.spotifyAPICalls.playListFromUri(selectedPlaylist.getUri());
			}
			return selectedPlaylist;
		}
		this.logger.warn(ITME_NOT_FOUND);
		return null;
	}

}