Package org.mockserver.model
Class PathModifier
- java.lang.Object
-
- org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
-
- org.mockserver.model.ObjectWithJsonToString
-
- org.mockserver.model.PathModifier
-
public class PathModifier extends ObjectWithJsonToString
-
-
Constructor Summary
Constructors Constructor Description PathModifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetRegex()StringgetSubstitution()inthashCode()Stringupdate(String path)NottableStringupdate(NottableString path)PathModifierwithRegex(String regex)The regex value to use to modify matching substrings, if multiple matches are found they will all be modified with the substitution for full details of supported regex syntax see: http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.htmlPathModifierwithSubstitution(String substitution)The pattern to substitute for the matched regex, matching groups are supported using $ followed by the group number for example $1-
Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toString
-
Methods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
-
-
-
Method Detail
-
getRegex
public String getRegex()
-
withRegex
public PathModifier withRegex(String regex)
The regex value to use to modify matching substrings, if multiple matches are found they will all be modified with the substitution for full details of supported regex syntax see: http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html
If a null or empty substitution string is provided the regex pattern will be used to remove any substring matching the regex
For example:
regex: ^/(.+)/(.+)$ substitution: /prefix/$1/infix/$2/postfix then: /some/path => /prefix/some/infix/path/postfix or: /some/longer/path => /prefix/some/infix/longer/path/postfix
- Parameters:
regex- regex value to match on
-
getSubstitution
public String getSubstitution()
-
withSubstitution
public PathModifier withSubstitution(String substitution)
The pattern to substitute for the matched regex, matching groups are supported using $ followed by the group number for example $1
If a null or empty substitution string is provided the regex pattern will be used to remove any substring matching the regex
- Parameters:
substitution- the value to substitute for the regex
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-
update
public NottableString update(NottableString path)
-
-