Skip to content

Instantly share code, notes, and snippets.

@Roberto-Gentili
Last active October 25, 2023 07:44
Show Gist options
  • Save Roberto-Gentili/8a5a6793cb1282360db7b74b4a4e3568 to your computer and use it in GitHub Desktop.
Save Roberto-Gentili/8a5a6793cb1282360db7b74b4a4e3568 to your computer and use it in GitHub Desktop.
//Searching for the first occurrence by path suffix
ObjectHandler sportOH = finder.findFirstForPathEndsWith("sport");
//Retrieving the path of the sport object ("quiz.sport")
String sportPath = sportOH.getPath();
//Retrieving the value of the sport object
Sport sport = sportOH.getValue();
ObjectHandler option2OfSportQuestionOH = finder.findFirstForPathEndsWith(Path.of("sport", "q1", "options[1]"));
String option2OfSportQuestionOHPath = option2OfSportQuestionOH.getPath();
String option2OfSportQuestion = option2OfSportQuestionOH.getValue();
ObjectHandler questionOneOH = finder.findForPathEquals(Path.of("quiz", "sport", "q1"));
String questionOnePath = questionOneOH.getPath();
Question questionOne = questionOneOH.getValue();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment