CategoryTreeImpl(final List<Category> roots, final List<Category> allAsFlatList, final Map<LocalizedStringEntry, Category> categoriesByLocaleAndSlug, final Map<String, Category> categoriesById, final Map<String, List<Category>> childrenByParentId) { this.childrenByParentId = childrenByParentId; this.roots = immutableCopyOf(roots); this.allAsFlatList = immutableCopyOf(allAsFlatList); this.categoriesByLocaleAndSlug = immutableCopyOf(categoriesByLocaleAndSlug); this.categoriesById = immutableCopyOf(categoriesById); }
CategoryTreeImpl(final List<Category> roots, final List<Category> allAsFlatList, final Map<LocaleSlugPair, Category> categoriesByLocaleAndSlug, final Map<String, Category> categoriesById) { this.roots = immutableCopyOf(roots); this.allAsFlatList = immutableCopyOf(allAsFlatList); this.categoriesByLocaleAndSlug = immutableCopyOf(categoriesByLocaleAndSlug); this.categoriesById = immutableCopyOf(categoriesById); }
CategoryTreeImpl(final List<Category> roots, final List<Category> allAsFlatList, final Map<LocaleSlugPair, Category> categoriesByLocaleAndSlug, final Map<String, Category> categoriesById) { this.roots = immutableCopyOf(roots); this.allAsFlatList = immutableCopyOf(allAsFlatList); this.categoriesByLocaleAndSlug = immutableCopyOf(categoriesByLocaleAndSlug); this.categoriesById = immutableCopyOf(categoriesById); }
CategoryTreeImpl(final List<Category> roots, final List<Category> allAsFlatList, final Map<LocaleSlugPair, Category> categoriesByLocaleAndSlug, final Map<String, Category> categoriesById) { this.roots = immutableCopyOf(roots); this.allAsFlatList = immutableCopyOf(allAsFlatList); this.categoriesByLocaleAndSlug = immutableCopyOf(categoriesByLocaleAndSlug); this.categoriesById = immutableCopyOf(categoriesById); }
final List<Category> childrenForCategory = immutableCopyOf(buildTreeRecursive(Optional.of(child), categoriesByParent.get(child.getId()), pathInTree, categoriesByParent)); final List<Category> pathInTreeForCategory = immutableCopyOf(pathInTree); final Optional<Reference<Category>> parentForCategory = parent.map(p -> p.toReference());
final List<Category> childrenForCategory = immutableCopyOf(buildTreeRecursive(Optional.of(child), categoriesByParent.get(child.getId()), pathInTree, categoriesByParent)); final List<Category> pathInTreeForCategory = immutableCopyOf(pathInTree); final Optional<Reference<Category>> parentForCategory = parent.map(p -> p.toReference());
final List<Category> childrenForCategory = immutableCopyOf(buildTreeRecursive(Optional.of(child), categoriesByParent.get(child.getId()), pathInTree, categoriesByParent)); final List<Category> pathInTreeForCategory = immutableCopyOf(pathInTree); final Optional<Reference<Category>> parentForCategory = parent.map(p -> p.toReference());