use of se.michaelthelin.spotify.model_objects.specification.User in project spotify-web-api-java by spotify-web-api-java.
the class GetCurrentUsersProfileExample method getCurrentUsersProfile_Sync.
public static void getCurrentUsersProfile_Sync() {
try {
final User user = getCurrentUsersProfileRequest.execute();
System.out.println("Display name: " + user.getDisplayName());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
use of se.michaelthelin.spotify.model_objects.specification.User in project spotify-web-api-java by spotify-web-api-java.
the class GetCurrentUsersProfileExample method getCurrentUsersProfile_Async.
public static void getCurrentUsersProfile_Async() {
try {
final CompletableFuture<User> userFuture = getCurrentUsersProfileRequest.executeAsync();
// Thread free to do other tasks...
// Example Only. Never block in production code.
final User user = userFuture.join();
System.out.println("Display name: " + user.getDisplayName());
} catch (CompletionException e) {
System.out.println("Error: " + e.getCause().getMessage());
} catch (CancellationException e) {
System.out.println("Async operation cancelled.");
}
}
use of se.michaelthelin.spotify.model_objects.specification.User in project spotify-web-api-java by spotify-web-api-java.
the class GetUsersProfileExample method getUsersProfile_Async.
public static void getUsersProfile_Async() {
try {
final CompletableFuture<User> userFuture = getUsersProfileRequest.executeAsync();
// Thread free to do other tasks...
// Example Only. Never block in production code.
final User user = userFuture.join();
System.out.println("Display name: " + user.getDisplayName());
} catch (CompletionException e) {
System.out.println("Error: " + e.getCause().getMessage());
} catch (CancellationException e) {
System.out.println("Async operation cancelled.");
}
}
use of se.michaelthelin.spotify.model_objects.specification.User in project spotify-web-api-java by spotify-web-api-java.
the class GetUsersProfileExample method getUsersProfile_Sync.
public static void getUsersProfile_Sync() {
try {
final User user = getUsersProfileRequest.execute();
System.out.println("Display name: " + user.getDisplayName());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
Aggregations