Class ThreadLocalMatcher
- java.lang.Object
-
- java.lang.ThreadLocal<java.util.regex.Matcher>
-
- com.github.fmjsjx.libnetty.http.server.ThreadLocalMatcher
-
public class ThreadLocalMatcher extends java.lang.ThreadLocal<java.util.regex.Matcher>Provides a thread-local variables ofMatchers.- Since:
- 1.1
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.regex.Patternpattern
-
Constructor Summary
Constructors Constructor Description ThreadLocalMatcher(java.util.regex.Pattern pattern)Construct a newThreadLocalMatcherinstance with the specified pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.regex.MatcherinitialValue()java.util.regex.Matchermatcher()Returns the thread-local matcher.java.util.regex.Patternpattern()Return the pattern that create matchers.java.util.regex.Matcherreset(java.lang.CharSequence input)Resets the thread-local matcher with a new input sequence.
-
-
-
Constructor Detail
-
ThreadLocalMatcher
public ThreadLocalMatcher(java.util.regex.Pattern pattern)
Construct a newThreadLocalMatcherinstance with the specified pattern.- Parameters:
pattern- the pattern that create matchers
-
-
Method Detail
-
pattern
public java.util.regex.Pattern pattern()
Return the pattern that create matchers.- Returns:
- the pattern that create matchers
-
initialValue
protected java.util.regex.Matcher initialValue()
- Overrides:
initialValuein classjava.lang.ThreadLocal<java.util.regex.Matcher>
-
matcher
public java.util.regex.Matcher matcher()
Returns the thread-local matcher.This method is equivalent to
ThreadLocal.get().- Returns:
- the thread-local matcher
-
reset
public java.util.regex.Matcher reset(java.lang.CharSequence input)
Resets the thread-local matcher with a new input sequence.- Parameters:
input- the new input character sequence- Returns:
- the thread-local matcher
-
-