| Modifier and Type | Method and Description |
|---|---|
static <T> MutableCategory<T> |
create(String name)
Create a new
MutableCategory with the given name |
static <T> CategoriesBuilder<T> |
createBuilder(String name)
Creates a new instance of a
CategoriesBuilder,
using the given name for the root category. |
static <T> Set<T> |
getAllElements(Category<T> category)
Returns a new set containing all elements of the given
Category
and its children. |
static <T> void |
mergeRecursively(MutableCategory<T> target,
Category<? extends T> source)
|
static void |
removeEmptyCategories(MutableCategory<?> category)
Clean up the given
Category. |
static String |
toFormattedString(Category<?> category)
Creates a formatted, multi-line string representation of the given
Category. |
public static <T> CategoriesBuilder<T> createBuilder(String name)
CategoriesBuilder,
using the given name for the root category.T - The type of the elements in the Categoryname - The name of the root CategoryCategoriesBuilder instancepublic static <T> MutableCategory<T> create(String name)
MutableCategory with the given nameT - The type of the elements in the Categoryname - The name of the CategoryMutableCategorypublic static <T> Set<T> getAllElements(Category<T> category)
Category
and its children.T - The type of the elements in the Categorycategory - The category to collect all elements frompublic static <T> void mergeRecursively(MutableCategory<T> target, Category<? extends T> source)
Category into the given target
Category. This merge will be performed recursively
for all sub-categories.T - The type of the elements in the Categorytarget - The MutableCategory to which the other will
be addedsource - The source Categorypublic static void removeEmptyCategories(MutableCategory<?> category)
Category. That is, this method will
recursively remove all categories from the given hierarchy that
have neither children nor
elements.category - The Category to clean uppublic static String toFormattedString(Category<?> category)
Category. category - The CategoryCopyright © 2018. All rights reserved.