Here you can find the source of assertIntegerGreaterThanZero(long number, String name)
Parameter | Description |
---|---|
number | the integer number to check. |
name | the integer's name. |
Parameter | Description |
---|---|
IllegalArgumentException | if the number if less than or equals to zero. |
static void assertIntegerGreaterThanZero(long number, String name)
//package com.java2s; public class Main { /**/* w w w .j a v a 2s . c om*/ * Check if the integer is greater than zero. * @param number * the integer number to check. * @param name * the integer's name. * @throws IllegalArgumentException * if the number if less than or equals to zero. */ static void assertIntegerGreaterThanZero(long number, String name) { if (number <= 0) { throw new IllegalArgumentException(name + " must be positive."); } } }