public BranchPage addBranch(String choice, Page... childPages) { PageList childPageList = new PageList(childPages); for (Page page : childPageList) { page.setParentKey(choice); } mBranches.add(new Branch(choice, childPageList)); return this; }
public BranchPage addBranch(String[] choices, String parentKey, Page... childPages) { PageList childPageList = new PageList(childPages); for (Page page : childPageList) { page.setParentKey(parentKey); } for (int i = 0; i < choices.length; i++) { mBranches.add(new Branch(choices[i], childPageList)); } return this; }