Package org.microproxy.extras
Record Class MapLocal.Rule
java.lang.Object
java.lang.Record
org.microproxy.extras.MapLocal.Rule
- Record Components:
filter- the requests the rule applies topattern- the regular expression searched for in the URLpath- the file, or the directory files are looked up in (absolute and real)
- Enclosing class:
MapLocal
One rule: requests the filter selects whose URL contains a match of
pattern are
answered from path.-
Constructor Summary
ConstructorsConstructorDescriptionRule(FlowFilter filter, Pattern pattern, Path path) 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 MapLocal.RuleParses a spec of the form[|flow-filter]|url-regex|file-or-directory.path()Returns the value of thepathrecord component.pattern()Returns the value of thepatternrecord 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|file-or-directory.- Parameters:
spec- the spec, starting with its separator- Returns:
- the rule
- Throws:
IllegalArgumentException- if the spec is invalid or the path does not exist
-
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
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-