public class CategoryTreeImpl extends java.lang.Object implements CategoryTree
| Modifier and Type | Method and Description |
|---|---|
static CategoryTreeImpl |
createAndBeginBuildInBackground(Categories categoryService,
java.util.Locale locale) |
java.util.List<Category> |
getAsFlatList()
All categories as a flat list, sorted by name.
|
Category |
getById(java.lang.String id)
Finds a category by id using a in-memory HashMap lookup.
|
Category |
getBySlug(java.lang.String slug)
Finds a category by the slug of the default locale using a in-memory HashMap lookup.
|
Category |
getBySlug(java.lang.String slug,
java.util.Locale locale)
Finds a category by the slug and a specific locale using a in-memory HashMap lookup.
|
java.util.List<Category> |
getRoots()
Root categories (the ones that have no parent).
|
java.util.List<Category> |
getRoots(java.util.Comparator<Category> comparator)
Root categories (the ones that have no parent) sorted by comparator for the root level.
|
void |
rebuildAsync()
Rebuilds the category cache for category tree implementations.
|
void |
shutdown()
Shuts down internal thread pools.
|
public static CategoryTreeImpl createAndBeginBuildInBackground(Categories categoryService, java.util.Locale locale)
public java.util.List<Category> getRoots()
CategoryTreegetRoots in interface CategoryTreepublic java.util.List<Category> getRoots(java.util.Comparator<Category> comparator)
CategoryTreegetRoots in interface CategoryTreepublic Category getById(java.lang.String id)
CategoryTreegetById in interface CategoryTreepublic Category getBySlug(java.lang.String slug)
CategoryTreegetBySlug in interface CategoryTreepublic Category getBySlug(java.lang.String slug, java.util.Locale locale)
CategoryTreegetBySlug in interface CategoryTreepublic java.util.List<Category> getAsFlatList()
CategoryTreegetAsFlatList in interface CategoryTreepublic void rebuildAsync()
CategoryTreerebuildAsync in interface CategoryTreepublic void shutdown()