use of se.michaelthelin.spotify.model_objects.specification.Artist in project spotify-web-api-java by spotify-web-api-java.
the class GetArtistExample method getArtist_Sync.
public static void getArtist_Sync() {
try {
final Artist artist = getArtistRequest.execute();
System.out.println("Name: " + artist.getName());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
use of se.michaelthelin.spotify.model_objects.specification.Artist in project spotify-web-api-java by spotify-web-api-java.
the class GetArtistExample method getArtist_Async.
public static void getArtist_Async() {
try {
final CompletableFuture<Artist> albumFuture = getArtistRequest.executeAsync();
// Thread free to do other tasks...
// Example Only. Never block in production code.
final Artist artist = albumFuture.join();
System.out.println("Name: " + artist.getName());
} catch (CompletionException e) {
System.out.println("Error: " + e.getCause().getMessage());
} catch (CancellationException e) {
System.out.println("Async operation cancelled.");
}
}
Aggregations