public abstract class HostMatcher extends AbstractMatcher
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
pathRegex
A regex that will be ran against the host name.
|
protected int |
port
The request port.
|
| Constructor and Description |
|---|
HostMatcher() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
matches(MatchInfo matchInfo)
Check if the uri is matching.
|
void |
setPathRegex(java.lang.String pathRegex)
The regular expression used to verify the path of the uri as is expected.
|
void |
setPort(int port) |
abstract java.lang.String |
toString() |
protected abstract com.google.common.base.Optional<java.lang.Boolean> |
tryOverrideValidation(MatchInfo matchInfo)
If the subclass has its own checks or if it has a different validation method this method can return a
valid value.
|
isReject, setRejectclone, finalize, getClass, notify, notifyAll, wait, wait, waitvalidateprotected int port
protected java.lang.String pathRegex
public final boolean matches(MatchInfo matchInfo) throws java.net.UnknownHostException, java.net.SocketException, java.net.MalformedURLException
URIMatchermatchInfo - the matching information to checkjava.net.UnknownHostExceptionjava.net.SocketExceptionjava.net.MalformedURLExceptionprotected abstract com.google.common.base.Optional<java.lang.Boolean> tryOverrideValidation(MatchInfo matchInfo) throws java.net.UnknownHostException, java.net.SocketException, java.net.MalformedURLException
matchInfo - the match information to validate.java.net.UnknownHostExceptionjava.net.SocketExceptionjava.net.MalformedURLExceptionpublic final void setPort(int port)
public final void setPathRegex(java.lang.String pathRegex)
The regular expression used are the ones supported by java: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
pathRegex - the regular expression.public abstract java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object