@Override public boolean applicable(final ServiceContext context) { final ValueProperty property = context.find(ValueProperty.class); if (property != null) { final NumericRange range = property.getAnnotation(NumericRange.class); return (range != null && (range.min().length() > 0 || range.max().length() > 0)); } return false; }
@Override protected void facts(final SortedSet<String> facts) { final ValueProperty property = context(ValueProperty.class); final NumericRange range = property.getAnnotation(NumericRange.class); final String min = range.min(); final String max = range.max(); if (min.length() > 0) { facts.add(minValueStatement.format(new ValueSnapshot(property, min))); } if (max.length() > 0) { facts.add(maxValueStatement.format(new ValueSnapshot(property, max))); } }