com.amazonaws.jmespath

## Class NumericComparator

- java.lang.Object
- - com.amazonaws.jmespath.Comparator
  - - com.amazonaws.jmespath.NumericComparator

All Implemented Interfaces:
  JmesPathExpression

Direct Known Subclasses:
  OpGreaterThan, OpGreaterThanOrEqualTo, OpLessThan, OpLessThanOrEqualTo

    public abstract class NumericComparator
    extends Comparator

### Field Summary

### Fields inherited from class com.amazonaws.jmespath.Comparator

`lhsExpr, rhsExpr`

### Constructor Summary

Constructors
Constructor and Description
`NumericComparator(JmesPathExpression lhsExpr, JmesPathExpression rhsExpr)` Constructs a new Comparator with the given lhs amd rhs expressions.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract boolean` `matches(BigDecimal lhs, BigDecimal rhs)` Abstract method definition that is overriden by the subclasses to compare the given lhs and rhs numbers according to the given comparator
`boolean` `matches(com.fasterxml.jackson.databind.JsonNode lhs, com.fasterxml.jackson.databind.JsonNode rhs)` Converts the lhs and rhs JsonNodes to the numeric values and delegates to the matches method that operates on the numeric values alone.

### Methods inherited from class com.amazonaws.jmespath.Comparator

`getLhsExpr, getRhsExpr`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface com.amazonaws.jmespath.JmesPathExpression

`accept`

### Constructor Detail

#### NumericComparator

    public NumericComparator(JmesPathExpression lhsExpr,
                             JmesPathExpression rhsExpr)

Constructs a new Comparator with the given lhs amd rhs expressions.

Parameters:
  `lhsExpr` - Left expression
  `rhsExpr` - Right expression

### Method Detail

#### matches

    public final boolean matches(com.fasterxml.jackson.databind.JsonNode lhs,
                                 com.fasterxml.jackson.databind.JsonNode rhs)

Converts the lhs and rhs JsonNodes to the numeric values and delegates to the matches method that operates on the numeric values alone.

Specified by:
  `matches` in class `Comparator`
Parameters:
  `lhs` - Lhs expression
  `rhs` - Rhs expression
Returns:
  Boolean result of the matches method of the corresponding comparison operator

#### matches

    public abstract boolean matches(BigDecimal lhs,
                                    BigDecimal rhs)

Abstract method definition that is overriden by the subclasses to compare the given lhs and rhs numbers according to the given comparator

Parameters:
  `lhs` - Lhs Number
  `rhs` - Rhs Number
Returns:
  True if the comparison is evaluated to true; False otherwise