Skip to content

Instantly share code, notes, and snippets.

@Tonel
Created October 29, 2022 09:06
Show Gist options
  • Save Tonel/6226fbd69d1d0057ac5df61d684cd599 to your computer and use it in GitHub Desktop.
Save Tonel/6226fbd69d1d0057ac5df61d684cd599 to your computer and use it in GitHub Desktop.
// extracting the first tuple from the list
Tuple bookGenreTuple = bookGenreTuples.get(0);
// getting the first element of the tuple
// and converting it into a Book object
Book book = bookGenreTuple.get(0, Book.class);
// getting the second element of the tuple
// and converting it into a Genre object
Genre genre = bookGenreTuple.get(1, Genre.class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment