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()
CategoryTree
getRoots
in interface CategoryTree
public java.util.List<Category> getRoots(java.util.Comparator<Category> comparator)
CategoryTree
getRoots
in interface CategoryTree
public Category getById(java.lang.String id)
CategoryTree
getById
in interface CategoryTree
public Category getBySlug(java.lang.String slug)
CategoryTree
getBySlug
in interface CategoryTree
public Category getBySlug(java.lang.String slug, java.util.Locale locale)
CategoryTree
getBySlug
in interface CategoryTree
public java.util.List<Category> getAsFlatList()
CategoryTree
getAsFlatList
in interface CategoryTree
public void rebuildAsync()
CategoryTree
rebuildAsync
in interface CategoryTree
public void shutdown()