Here you can find the source of assertLongPositive(long val, String name)
Parameter | Description |
---|---|
val | the given long value to check. |
name | the name to identify the long value. |
Parameter | Description |
---|---|
IllegalArgumentException | if the given long value is negative or zero. |
static void assertLongPositive(long val, String name)
//package com.java2s; public class Main { /**/*from w ww . jav a 2s . c om*/ * Check if the given long value is positive. * * @param val the given long value to check. * @param name the name to identify the long value. * @throws IllegalArgumentException if the given long value is negative or zero. */ static void assertLongPositive(long val, String name) { if (val <= 0) { throw new IllegalArgumentException(name + " [" + val + "] should be positive."); } } }