public void setFieldSetMappers(Map<String, FieldSetMapper<T>> fieldSetMappers) { Assert.isTrue(!fieldSetMappers.isEmpty(), "The 'fieldSetMappers' property must be non-empty"); this.patternMatcher = new PatternMatcher<>(fieldSetMappers); } }
public void setTokenizers(Map<String, LineTokenizer> tokenizers) { Assert.isTrue(!tokenizers.isEmpty(), "The 'tokenizers' property must be non-empty"); this.tokenizers = new PatternMatcher<>(tokenizers); } }
@Test(expected = IllegalStateException.class) public void testMatchPrefixNoMatch() { new PatternMatcher<>(map).match("bat"); }
@Test public void testMatchPrefixSubsumed() { assertEquals(2, new PatternMatcher<>(map).match("apple").intValue()); }
@Test public void testMatchPrefixUnrelated() { assertEquals(4, new PatternMatcher<>(map).match("biggest").intValue()); }
@Test public void testMatchPrefixSubsuming() { assertEquals(3, new PatternMatcher<>(map).match("animal").intValue()); }
@Test public void testMatchPrefixDefaultValueNoMatch() { assertEquals(1, new PatternMatcher<>(defaultMap).match("bat").intValue()); } }
@Test public void testMatchPrefixDefaultValueUnrelated() { assertEquals(5, new PatternMatcher<>(defaultMap).match("biggest").intValue()); }
@Test public void testMatchPrefixDefaultValueEmptyString() { assertEquals(1, new PatternMatcher<>(defaultMap).match("").intValue()); }
public void setFieldSetMappers(Map<String, FieldSetMapper<T>> fieldSetMappers) { Assert.isTrue(!fieldSetMappers.isEmpty(), "The 'fieldSetMappers' property must be non-empty"); this.patternMatcher = new PatternMatcher<FieldSetMapper<T>>(fieldSetMappers); } }
public void setTokenizers(Map<String, LineTokenizer> tokenizers) { Assert.isTrue(!tokenizers.isEmpty(), "The 'tokenizers' property must be non-empty"); this.tokenizers = new PatternMatcher<LineTokenizer>(tokenizers); } }