/** * Search an initial option by screen name * * @param screen Screen name * @return Option found */ @JsonIgnore public Option getOptionByScreen(String screen) { Option option = null; List<Option> optionList = getElementList(); // Search in child options for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByScreen(screen); } } return option; }
/** * Search an initial option by screen name * * @param screen Screen name * @return Option found */ @JsonIgnore public Option getOptionByScreen(String screen) { // Variable definition Option option = null; // Found screen if (this.getScreen() != null && this.getScreen().equals(screen)) { option = this; } else { // Search in child options List<Option> optionList = getElementList(); for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByScreen(screen); } } } return option; }