public class Transcription extends Object implements Sortable<Transcription>
| Modifier and Type | Field and Description |
|---|---|
protected int |
priority |
| Constructor and Description |
|---|
Transcription(Pattern pattern,
String replaceWith) |
Transcription(Pattern regex,
String replaceWith,
boolean replaceEntirePath,
boolean firstOccurrenceOnly)
Convenience method which creates a
Transcription with a Pattern criteria. |
Transcription(String regex,
String replaceWith)
Replaces/re-writes the entire request path with the given replacement
|
Transcription(String regex,
String replaceWith,
boolean replaceEntirePath)
Rewrites/replaced a request based on the provided options
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Transcription that) |
boolean |
equals(Object o) |
long |
getCreatedAt() |
Pattern |
getPattern() |
String |
getReplacementPath() |
int |
hashCode() |
boolean |
isReplaceFirstOccurrence() |
boolean |
isReplaceWholeRequest() |
boolean |
matches(String uri) |
int |
priority() |
String |
replaceAllMatches(String uri) |
String |
replaceFirstMatch(String uri) |
void |
setPattern(Pattern pattern) |
int |
setPriority(int value) |
void |
setReplaceFirstOccurrence(boolean firstOccurrenceOnly) |
void |
setReplacementPath(String replaceWith) |
void |
setReplaceWholeRequest(boolean replace) |
public Transcription(String regex, String replaceWith, boolean replaceEntirePath)
regex - a regex to matchreplaceWith - a replacement string to be used to replace matchesreplaceEntirePath - if true the request's entire path is replaced with the replacement stringpublic Transcription(Pattern regex, String replaceWith, boolean replaceEntirePath, boolean firstOccurrenceOnly)
Transcription with a Pattern criteria.
if an HTTP request's path pattern the given regex, replace all occurrences with
the provided alternativeregex - the regex to use for searchreplaceWith - the string to replace it with if it begins with the startsWith paramreplaceEntirePath - if true then the entire request path is replace, otherwise only the
startWith portion is replaced from the start of the stringfirstOccurrenceOnly - if true only the first occurrence of the pattern is replaced/re-writtenpublic Transcription(String regex, String replaceWith)
regex - the regex to matchreplaceWith - the string to replace withpublic long getCreatedAt()
public Pattern getPattern()
public void setPattern(Pattern pattern)
public boolean matches(String uri)
public boolean isReplaceWholeRequest()
public void setReplaceWholeRequest(boolean replace)
public String getReplacementPath()
public void setReplacementPath(String replaceWith)
public boolean isReplaceFirstOccurrence()
public void setReplaceFirstOccurrence(boolean firstOccurrenceOnly)
public int setPriority(int value)
setPriority in interface Sortable<Transcription>public int priority()
priority in interface Sortable<Transcription>public int compareTo(Transcription that)
compareTo in interface Comparable<Transcription>Copyright © 2012-2015. All Rights Reserved.