Class PathModifier


public class PathModifier extends ObjectWithJsonToString
  • Constructor Details

    • PathModifier

      public PathModifier()
  • Method Details

    • 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:
      equals in class ObjectWithReflectiveEqualsHashCodeToString
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ObjectWithReflectiveEqualsHashCodeToString
    • update

      public NottableString update(NottableString path)
    • update

      public String update(String path)