it.jnrpe.utils.thresholds
Class LegacyRange

java.lang.Object
  extended by it.jnrpe.utils.thresholds.LegacyRange

public class LegacyRange
extends Object

Utility class for evaluating thresholds. This class represent a Threshold specified using the old Nagios syntax.

Author:
Massimiliano Ziccardi

Constructor Summary
LegacyRange(String threshold)
          Builds the object with the specified range.
 
Method Summary
 boolean isValueInside(BigDecimal value)
          Returns true if the value falls inside the range.
 boolean isValueInside(BigDecimal value, Prefixes prefix)
          Returns true if the value falls inside the range.
 boolean isValueInside(int value)
          Returns true if the value falls inside the range.
 boolean isValueInside(long value)
          Returns true if the value falls inside the range.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegacyRange

public LegacyRange(String threshold)
            throws BadThresholdException
Builds the object with the specified range.

Parameters:
threshold - The range
Throws:
BadThresholdException - -
Method Detail

isValueInside

public final boolean isValueInside(BigDecimal value)
Returns true if the value falls inside the range.

Parameters:
value - The value
Returns:
true if the value falls inside the range. false otherwise.

isValueInside

public final boolean isValueInside(BigDecimal value,
                                   Prefixes prefix)
Returns true if the value falls inside the range.

Parameters:
value - The value
prefix - The prefix that identifies the multiplier
Returns:
true if the value falls inside the range. false otherwise.

isValueInside

public final boolean isValueInside(int value)
Returns true if the value falls inside the range.

Parameters:
value - The value
Returns:
true if the value falls inside the range. false otherwise.

isValueInside

public final boolean isValueInside(long value)
Returns true if the value falls inside the range.

Parameters:
value - The value
Returns:
true if the value falls inside the range. false otherwise.


Copyright © 2014. All Rights Reserved.