public static void inBounds ( final Integer input , final Integer min , final Integer max , final String inputName ) { notNull ( input , inputName ) ; if ( ( min != null ) && ( input < min ) ) { throw new IndexOutOfBoundsException ( "a value of " + input . toString ( ) + " was unexpected for " + maskNullArgument ( inputName ) + ", it is expected to be less than " + min . toString ( ) ) ; } if ( ( max != null ) && ( input > max ) ) { throw new IndexOutOfBoundsException ( "a value of " + input . toString ( ) + " was unexpected for " + maskNullArgument ( inputName ) + ", it is expected to be greater than " + max . toString ( ) ) ; } }
Checks that the input value is within the bounds of a maximum or minimum value