public class PathModifier extends ObjectWithJsonToString
Constructor and Description |
---|
PathModifier() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getRegex() |
String |
getSubstitution() |
int |
hashCode() |
NottableString |
update(NottableString path) |
String |
update(String path) |
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
|
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
|
toString
fieldsExcludedFromEqualsAndHashCode
public String getRegex()
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
regex
- regex value to match onpublic String getSubstitution()
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
substitution
- the value to substitute for the regexpublic boolean equals(Object o)
equals
in class ObjectWithReflectiveEqualsHashCodeToString
public int hashCode()
hashCode
in class ObjectWithReflectiveEqualsHashCodeToString
public NottableString update(NottableString path)
Copyright © 2022. All rights reserved.