class SpotifySpeech {

	@Intent()
	public String getPlaylists(Map<String, EntityData> entites) {
		StringBuilder builder = new StringBuilder();
		int amount = LIMIT_FOR_SEARCH;
		if (entites.get("number") != null) {
			amount = entites.get("number").getNumber();
		}
		if (entites.get("type").getString() != null) {
			switch (entites.get("type").getString()) {
			case "featured":
				for (PlaylistEntity playlist : this.search.searchFeaturedPlaylists(amount)) {
					builder = builder.append(playlist.toString()).append("\n");
				}
				break;
			case "own":
			case "on":
				for (PlaylistEntity playlist : this.search.searchOwnPlaylists(amount)) {
					builder = builder.append(playlist.toString()).append("\n");
				}
				break;
			default:
				break;
			}
		}
		if (builder.length() > 0) {
			builder.insert(0, "Following Playlists found: \n");
		} else {
			builder.append("No playlists found");
		}
		return builder.toString();

	}

}