Package org.mockserver.model
Class PathModifier
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.model.PathModifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetRegex()inthashCode()update(NottableString path) 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.htmlwithSubstitution(String substitution) The pattern to substitute for the matched regex, matching groups are supported using $ followed by the group number for example $1Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
PathModifier
public PathModifier()
-
-
Method Details
-
getRegex
-
withRegex
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
-
withSubstitution
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
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-
update
-
update
-