/** * Return a description explaining this category. * * @return a {@link java.lang.String} object. */ @XmlElement(name="comment") public String getComment() { return m_categoryDef == null? null : m_categoryDef.getComment().orElse(null); }
/** * Return a description explaining this category. * * @return a {@link java.lang.String} object. */ @XmlElement(name="comment") public String getComment() { return m_categoryDef == null? null : m_categoryDef.getComment().orElse(null); }
/** * Look up the category definition and return the category's description. * * @param categoryName a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public String getCategoryComment(final String categoryName) { if (categoryName == null) { throw new IllegalArgumentException("Cannot take null parameters."); } String comment = null; m_factory.getReadLock().lock(); try { org.opennms.netmgt.config.categories.Category category = m_factory.getCategory(categoryName); if (category != null) { comment = category.getComment().orElse(null); } } finally { m_factory.getReadLock().unlock(); } return comment; }
/** * Look up the category definition and return the category's description. * * @param categoryName a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public String getCategoryComment(final String categoryName) { if (categoryName == null) { throw new IllegalArgumentException("Cannot take null parameters."); } String comment = null; m_factory.getReadLock().lock(); try { org.opennms.netmgt.config.categories.Category category = m_factory.getCategory(categoryName); if (category != null) { comment = category.getComment().orElse(null); } } finally { m_factory.getReadLock().unlock(); } return comment; }
cat.getWarningThreshold(), cat.getNormalThreshold(), cat.getComment().orElse(null), cat.getLabel(), format, } else { org.opennms.reporting.availability.Category category = new org.opennms.reporting.availability.Category(); category.setCatComments(cat.getComment().orElse(null)); category.setCatName(cat.getLabel()); category.setCatIndex(catIndex);
cat.getWarningThreshold(), cat.getNormalThreshold(), cat.getComment().orElse(null), cat.getLabel(), format, } else { org.opennms.reporting.availability.Category category = new org.opennms.reporting.availability.Category(); category.setCatComments(cat.getComment().orElse(null)); category.setCatName(cat.getLabel()); category.setCatIndex(catIndex);
public void testGetCategory() { Category category = m_catFactory.getCategory(CATLABEL); assertEquals(99,category.getNormalThreshold(),0); assertEquals(97,category.getWarningThreshold(),0); assertTrue(category.getComment().isPresent()); assertEquals(CATCOMMENT,category.getComment().get()); assertEquals(CATRULE,category.getRule()); assertEquals("ICMP",category.getServices().get(0)); assertEquals("SNMP",category.getServices().get(1)); }
/** * The default constructor - initializes the values * * @param cat a {@link org.opennms.netmgt.config.categories.Category} object. * @param commonRule a {@link java.lang.String} object. */ public RTCCategory(Category cat, String commonRule) { setLabel(cat.getLabel()); setComment(cat.getComment().orElse(null)); setRule(cat.getRule()); setNormalThreshold(cat.getNormalThreshold()); setWarningThreshold(cat.getWarningThreshold()); setServices(cat.getServices()); m_effectiveRule = "(" + commonRule + ") & (" + cat.getRule() + ")"; }