Search in sources :

Example 1 with Catinfo

use of org.opennms.netmgt.config.categories.Catinfo in project opennms by OpenNMS.

the class DefaultCategoryConfigDao method findAll.

/**
 * <p>findAll</p>
 *
 * @return a {@link java.util.Collection} object.
 */
@Override
public Collection<Category> findAll() {
    List<Category> catList = new ArrayList<>();
    Catinfo catInfo = CategoryFactory.getInstance().getConfig();
    List<CategoryGroup> catGroupList = catInfo.getCategoryGroups();
    if (catGroupList != null) {
        for (final CategoryGroup cg : catGroupList) {
            catList.addAll(cg.getCategories());
        }
    }
    return catList;
}
Also used : Category(org.opennms.netmgt.config.categories.Category) ArrayList(java.util.ArrayList) Catinfo(org.opennms.netmgt.config.categories.Catinfo) CategoryGroup(org.opennms.netmgt.config.categories.CategoryGroup)

Aggregations

ArrayList (java.util.ArrayList)1 Category (org.opennms.netmgt.config.categories.Category)1 CategoryGroup (org.opennms.netmgt.config.categories.CategoryGroup)1 Catinfo (org.opennms.netmgt.config.categories.Catinfo)1