MetadataNumberCondition
Met when a metadata field has a numeric value satisfying a comparison, such as a size.
Notes
Met when at least one value of at least one field whose name matches fieldMatcher is a number satisfying the comparison. Decimals are supported, using a dot as the decimal character. A missing field or a value that is not a number is never a match.
Use one value matcher to compare with a number, or two to define a range (both must be satisfied). With none, the condition is met when the value is a number.
Examples
Between 1 KB and 1 MB:
- YAML
- JSON
- XML
class: MetadataNumberCondition
fieldMatcher:
pattern: Content-Length
valueMatcher:
operator: ge
number: 1024
valueMatcherRangeEnd:
operator: lt
number: 1048576
{
"class": "MetadataNumberCondition",
"fieldMatcher": {
"pattern": "Content-Length"
},
"valueMatcher": {
"operator": "ge",
"number": 1024
},
"valueMatcherRangeEnd": {
"operator": "lt",
"number": 1048576
}
}
<class>MetadataNumberCondition</class>
<fieldMatcher>
<pattern>Content-Length</pattern>
</fieldMatcher>
<valueMatcher>
<operator>ge</operator>
<number>1024</number>
</valueMatcher>
<valueMatcherRangeEnd>
<operator>lt</operator>
<number>1048576</number>
</valueMatcherRangeEnd>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: MetadataNumberCondition
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
valueMatcher:
number: 0
operator: gt
valueMatcherRangeEnd:
number: 0
operator: gt
{
"class": "MetadataNumberCondition",
"fieldMatcher": {
"ignoreCase": false,
"ignoreDiacritic": false,
"matchEmpty": false,
"method": "BASIC",
"negateMatches": false,
"partial": false,
"pattern": "string",
"replaceAll": false,
"trim": false
},
"valueMatcher": {
"number": 0,
"operator": "gt"
},
"valueMatcherRangeEnd": {
"number": 0,
"operator": "gt"
}
}
<condition>
<class>MetadataNumberCondition</class>
<fieldMatcher>
<ignoreCase>false</ignoreCase>
<ignoreDiacritic>false</ignoreDiacritic>
<matchEmpty>false</matchEmpty>
<method>BASIC</method>
<negateMatches>false</negateMatches>
<partial>false</partial>
<pattern>string</pattern>
<replaceAll>false</replaceAll>
<trim>false</trim>
</fieldMatcher>
<valueMatcher>
<number>0</number>
<operator>gt</operator>
</valueMatcher>
<valueMatcherRangeEnd>
<number>0</number>
<operator>gt</operator>
</valueMatcherRangeEnd>
</condition>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
fieldMatcher | TextMatcher | No | TextMatcher |
valueMatcher | NumericValueMatcher | No | - |
valueMatcherRangeEnd | NumericValueMatcher | No | - |
Property Details
fieldMatcher
Matches metadata field names. Required.
valueMatcher
The comparison to satisfy: an operator (gt, ge, lt, le or eq; the symbols >, >=, <, <= and =, and the names GREATER_THAN, GREATER_EQUAL, LOWER_THAN, LOWER_EQUAL and EQUALS also work, ignoring case and punctuation) and a number.
valueMatcherRangeEnd
A second comparison that must also be satisfied, to define a range together with valueMatcher.