@Test public void getPatternWtihNotSamePatternTest() { EntityId entityId = new EntityId("A*", "string", true); EntityId entityId2 = new EntityId("B*", "string", true); Patterns patterns = new Patterns(); Pattern pattern = patterns.getPattern(entityId); assertNotEquals(pattern, patterns.getPattern(entityId2)); }
public Pattern getPattern(final EntityId entityId) throws PatternSyntaxException { if (!entityId.getIsPattern()) { return null; } String id = entityId.getId(); Pattern pattern = cachedPatterns.get(id); if (pattern == null) { pattern = Pattern.compile(id); cachedPatterns.put(id, pattern); } return pattern; }
Patterns { public Pattern getPattern(final EntityId entityId) throws PatternSyntaxException { if (!entityId.getIsPattern()) { return null; } String id = entityId.getId(); Pattern pattern = cachedPatterns.get(id); if (pattern == null) { pattern = Pattern.compile(id); cachedPatterns.put(id, pattern); } return pattern; } }
Patterns { public Pattern getPattern(final EntityId entityId) throws PatternSyntaxException { if (!entityId.getIsPattern()) { return null; } String id = entityId.getId(); Pattern pattern = cachedPatterns.get(id); if (pattern == null) { pattern = Pattern.compile(id); cachedPatterns.put(id, pattern); } return pattern; }  }
Patterns { public Pattern getPattern(final EntityId entityId) throws PatternSyntaxException { if (!entityId.getIsPattern()) { return null; } String id = entityId.getId(); Pattern pattern = cachedPatterns.get(id); if (pattern == null) { pattern = Pattern.compile(id); cachedPatterns.put(id, pattern); } return pattern; }  Pattern getPattern(final EntityId entityId); boolean hasType(final EntityId entityId); Predicate<EntityId> getFilterEntityId(EntityId searchEntityId); }
Patterns { public Pattern getPattern(final EntityId entityId) throws PatternSyntaxException { if (!entityId.getIsPattern()) { return null; } String id = entityId.getId(); Pattern pattern = cachedPatterns.get(id); if (pattern == null) { pattern = Pattern.compile(id); cachedPatterns.put(id, pattern); } return pattern; }  Pattern getPattern(final EntityId entityId); boolean hasType(final EntityId entityId); Predicate<EntityId> getFilterEntityId(EntityId searchEntityId);  }