@Test public void testGetThread() { }
public String getThread() { String regex = "\\[\\w+-\\d+\\s\\w+-\\w+\\d+\\]"; Pattern thread = Pattern.compile(regex); Matcher threadMatcher = thread.matcher(getMessage()); if(threadMatcher.find()) { return threadMatcher.group(); } return null; }
SimpleLogMessage implements LogMessage { public String getThread() { String regex = "\\[\\w+-\\d+\\s\\w+-\\w+\\d+\\]"; Pattern thread = Pattern.compile(regex); Matcher threadMatcher = thread.matcher(getMessage()); if(threadMatcher.find()) { return threadMatcher.group(); } return null; } }
SimpleLogMessage implements LogMessage { public String getThread() { String regex = "\\[\\w+-\\d+\\s\\w+-\\w+\\d+\\]"; Pattern thread = Pattern.compile(regex); Matcher threadMatcher = thread.matcher(getMessage()); if(threadMatcher.find()) { return threadMatcher.group(); } return null; } private  SimpleLogMessage(String logMessage); }
SimpleLogMessage implements LogMessage { public String getThread() { String regex = "\\[\\w+-\\d+\\s\\w+-\\w+\\d+\\]"; Pattern thread = Pattern.compile(regex); Matcher threadMatcher = thread.matcher(getMessage()); if(threadMatcher.find()) { return threadMatcher.group(); } return null; } private  SimpleLogMessage(String logMessage); static LogMessage create(String logMessage); String getMessage(); boolean isEndMessage(); @Override String toString(); boolean isPersistMessage(); boolean isPersistBeginMessage(); boolean isPersistEndMessage(); boolean isBeginMessage(); boolean isErrorMessage(); boolean isCollectorBeginMessage(); boolean isCollectorEndMessage(); Date getDate(); String getServiceID(); String getThread(); }
SimpleLogMessage implements LogMessage { public String getThread() { String regex = "\\[\\w+-\\d+\\s\\w+-\\w+\\d+\\]"; Pattern thread = Pattern.compile(regex); Matcher threadMatcher = thread.matcher(getMessage()); if(threadMatcher.find()) { return threadMatcher.group(); } return null; } private  SimpleLogMessage(String logMessage); static LogMessage create(String logMessage); String getMessage(); boolean isEndMessage(); @Override String toString(); boolean isPersistMessage(); boolean isPersistBeginMessage(); boolean isPersistEndMessage(); boolean isBeginMessage(); boolean isErrorMessage(); boolean isCollectorBeginMessage(); boolean isCollectorEndMessage(); Date getDate(); String getServiceID(); String getThread();  }