net.dontdrinkandroot.utils.lang.math

## Class NumberUtils

- java.lang.Object
- - org.apache.commons.lang3.math.NumberUtils
  - - net.dontdrinkandroot.utils.lang.math.NumberUtils

    public class NumberUtils
    extends org.apache.commons.lang3.math.NumberUtils

Provides extra functionality for Java Number classes.

Author:
  Philip W. Sorst

### Field Summary

### Fields inherited from class org.apache.commons.lang3.math.NumberUtils

`BYTE_MINUS_ONE, BYTE_ONE, BYTE_ZERO, DOUBLE_MINUS_ONE, DOUBLE_ONE, DOUBLE_ZERO, FLOAT_MINUS_ONE, FLOAT_ONE, FLOAT_ZERO, INTEGER_MINUS_ONE, INTEGER_ONE, INTEGER_ZERO, LONG_MINUS_ONE, LONG_ONE, LONG_ZERO, SHORT_MINUS_ONE, SHORT_ONE, SHORT_ZERO`

### Constructor Summary

Constructors
`protected` `NumberUtils()` Disabled constructor, utility class.

### Method Summary

Methods
`static byte` `byteValue(Number number)` Get the null safe byteValue of a Number.
`static int` `compare(int lhs, int rhs)`
`static double` `doubleValue(Number number)` Get the null safe doubleValue of a Number.
`static float` `floatValue(Number number)` Get the null safe floatValue of a Number.
`static int` `intValue(Number number)` Get the null safe intValue of a Number.
`static double` `limit(double value, double min, double max)`
`static float` `limit(float value, float min, float max)`
`static int` `limit(int value, int min, int max)`
`static long` `limit(long value, long min, long max)`
`static long` `longValue(Number number)` Get the null safe longValue of a Number.
`static short` `shortValue(Number number)` Get the null safe shortValue of a Number.

### Methods inherited from class org.apache.commons.lang3.math.NumberUtils

`createBigDecimal, createBigInteger, createDouble, createFloat, createInteger, createLong, createNumber, isDigits, isNumber, max, max, max, max, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, min, min, min, min, toByte, toByte, toDouble, toDouble, toFloat, toFloat, toInt, toInt, toLong, toLong, toShort, toShort`

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

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

### Constructor Detail

#### NumberUtils

    protected NumberUtils()

Disabled constructor, utility class.

### Method Detail

#### intValue

    public static int intValue(Number number)

Get the null safe intValue of a Number. Defaults to 0.

Parameters:
  `number` - The Number to convert.
Returns:
  The null safe intValue. Defaults to 0.

#### doubleValue

    public static double doubleValue(Number number)

Get the null safe doubleValue of a Number. Defaults to 0.

Parameters:
  `number` - The Number to convert.
Returns:
  The null safe doubleValue. Defaults to 0.

#### byteValue

    public static byte byteValue(Number number)

Get the null safe byteValue of a Number. Defaults to 0.

Parameters:
  `number` - The Number to convert.
Returns:
  The null safe byteValue. Defaults to 0.

#### longValue

    public static long longValue(Number number)

Get the null safe longValue of a Number. Defaults to 0.

Parameters:
  `number` - The Number to convert.
Returns:
  The null safe longValue. Defaults to 0.

#### shortValue

    public static short shortValue(Number number)

Get the null safe shortValue of a Number. Defaults to 0.

Parameters:
  `number` - The Number to convert.
Returns:
  The null safe shortValue. Defaults to 0.

#### floatValue

    public static float floatValue(Number number)

Get the null safe floatValue of a Number. Defaults to 0.

Parameters:
  `number` - The Number to convert.
Returns:
  The null safe floatValue. Defaults to 0.

#### limit

    public static int limit(int value,
            int min,
            int max)

#### limit

    public static long limit(long value,
             long min,
             long max)

#### limit

    public static float limit(float value,
              float min,
              float max)

#### limit

    public static double limit(double value,
               double min,
               double max)

#### compare

    public static int compare(int lhs,
              int rhs)