- // condition1: AF value contains "dog" (matches)
- KeyedMatcherI km1 = new KeyedMatcher("AF", new Matcher(
- Condition.Contains, "dog"));
-
- Function<String, String> vp = key -> "AF".equals(key) ? "raining cats and dogs"
- : "showers";
- assertTrue(km1.matches(vp));
-
- // condition 2: CSQ value does not contain "how" (does not match)
- // the OR combination still passes
- KeyedMatcherI km2 = km1.or("CSQ", new Matcher(Condition.NotContains,
- "how"));
- assertTrue(km2.matches(vp));
+ KeyedMatcherI km = new KeyedMatcher("AF", Condition.GE, -2F);
+ assertEquals(km.getMatcher().getCondition(), Condition.GE);
+ assertEquals(km.getMatcher().getFloatValue(), -2F);
+ assertEquals(km.getMatcher().getPattern(), "-2.0");