private boolean evaluate ( final Metric metric , final Prefixes prefix ) { if ( metric == null || metric . getMetricValue ( ) == null ) { throw new NullPointerException ( "Value can't be null" ) ; } BigDecimal value = metric . getMetricValue ( prefix ) ; if ( ! isNegativeInfinity ( ) ) { switch ( value . compareTo ( getLeftBoundary ( ) ) ) { case 0 : if ( ! isLeftInclusive ( ) ) { return false ; } break ; case - 1 : return false ; default : } } if ( ! isPositiveInfinity ( ) ) { switch ( value . compareTo ( getRightBoundary ( ) ) ) { case 0 : if ( ! isRightInclusive ( ) ) { return false ; } break ; case 1 : return false ; default : } } return true ; }
Evaluates if the passed in value falls inside the range . The negation is ignored .