@Test public void testMultiSearchingPattern() { SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder(); patternBuilder.add("abc", PrivateDataType.regex_credit_card_number.name()) .add("bcd", PrivateDataType.regex_credit_card_number.name()) .add("def", PrivateDataType.regex_credit_card_number.name()); SearchingContent content = new SearchingContent("abcde"); SearchingResult result = searchingHandler.search(patternBuilder.build(), content); assertNotNull(result); assertEquals(2, result.getWords().size()); }
@Override public SearchingResult search(SearchingPattern pattern, SearchingContent content) { if (!isValidPattern(pattern) || !isValidContent(content)) { return new SearchingResultBuilder().build(); } return searchingStrategy.applySearch(pattern, content); }
KeywordSearchingHandler implements ISearchingHandler { @Override public SearchingResult search(SearchingPattern pattern, SearchingContent content) { if (!isValidPattern(pattern) || !isValidContent(content)) { return new SearchingResultBuilder().build(); } return searchingStrategy.applySearch(pattern, content); } }
KeywordSearchingHandler implements ISearchingHandler { @Override public SearchingResult search(SearchingPattern pattern, SearchingContent content) { if (!isValidPattern(pattern) || !isValidContent(content)) { return new SearchingResultBuilder().build(); } return searchingStrategy.applySearch(pattern, content); }  }
KeywordSearchingHandler implements ISearchingHandler { @Override public SearchingResult search(SearchingPattern pattern, SearchingContent content) { if (!isValidPattern(pattern) || !isValidContent(content)) { return new SearchingResultBuilder().build(); } return searchingStrategy.applySearch(pattern, content); }  @Override SearchingResult search(SearchingPattern pattern, SearchingContent content); @Override boolean isValidPattern(SearchingPattern pattern); @Override boolean isValidContent(SearchingContent content); }
KeywordSearchingHandler implements ISearchingHandler { @Override public SearchingResult search(SearchingPattern pattern, SearchingContent content) { if (!isValidPattern(pattern) || !isValidContent(content)) { return new SearchingResultBuilder().build(); } return searchingStrategy.applySearch(pattern, content); }  @Override SearchingResult search(SearchingPattern pattern, SearchingContent content); @Override boolean isValidPattern(SearchingPattern pattern); @Override boolean isValidContent(SearchingContent content);  }