Class NumericCondition
java.lang.Object
com.norconex.importer.handler.condition.impl.NumericCondition
- All Implemented Interfaces:
Configurable<NumericConditionConfig>,Condition,ConfigurableCondition<NumericConditionConfig>,FailablePredicate<DocHandlerContext,IOException>
public class NumericCondition
extends Object
implements ConfigurableCondition<NumericConditionConfig>
A condition based on the numeric value(s) of matching
metadata fields, supporting decimals. If multiple values are found for a
field, only one of them needs to match for this condition to be true.
If the value is not a valid number, it is considered not to be matching
(i.e., false).
The decimal character is expected to be a dot (".").
The default operator is "eq" (equals).
Single number vs range of numbers:
This condition accepts zero, one, or two value matchers:
- 0: Use no value matcher to simply evaluate whether the value is a number (including decimal support).
- 1: Use one value matcher to evaluate if the value is lower/greater and/or the same as the specified number.
-
2: Use two value matchers to define a numeric range to evaluate
(both matches have to evaluate to
true).
Operator- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.norconex.commons.lang.config.Configurable
PROPERTYFields inherited from interface org.apache.commons.lang3.function.FailablePredicate
FALSE, TRUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleaninthashCode()booleantest(DocHandlerContext docCtx) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.lang3.function.FailablePredicate
and, negate, or
-
Constructor Details
-
NumericCondition
public NumericCondition()
-
-
Method Details
-
test
- Specified by:
testin interfaceFailablePredicate<DocHandlerContext,IOException> - Throws:
IOException
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurable<NumericConditionConfig>
-