Package org.microproxy.extras
Record Class MapRemote.Rule
java.lang.Object
java.lang.Record
org.microproxy.extras.MapRemote.Rule
- Record Components:
filter- the requests the rule applies topattern- the regular expression replaced in the URLreplacement- the replacement, inMatcher.replaceAll(java.lang.String)syntax
- Enclosing class:
MapRemote
public static record MapRemote.Rule(FlowFilter filter, Pattern pattern, String replacement)
extends Record
One rule: requests the filter matches have every match of
pattern in their URL
replaced.-
Constructor Summary
ConstructorsConstructorDescriptionRule(FlowFilter filter, Pattern pattern, String replacement) Checks that every part is present. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.filter()Returns the value of thefilterrecord component.final inthashCode()Returns a hash code value for this object.static MapRemote.RuleParses a spec of the form[|flow-filter]|url-regex|replacement.pattern()Returns the value of thepatternrecord component.Returns the value of thereplacementrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Rule
Checks that every part is present.
-
-
Method Details
-
parse
Parses a spec of the form[|flow-filter]|url-regex|replacement.- Parameters:
spec- the spec, starting with its separator- Returns:
- the rule
- Throws:
IllegalArgumentException- if the spec or its filter or regex is invalid
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
filter
Returns the value of thefilterrecord component.- Returns:
- the value of the
filterrecord component
-
pattern
Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-
replacement
Returns the value of thereplacementrecord component.- Returns:
- the value of the
replacementrecord component
-