Java Assert assertPositive(int value)

Here you can find the source of assertPositive(int value)

Description

throws an IllegalArgumentException if the value is smaller then 0

License

Open Source License

Parameter

Parameter Description
value a parameter

Declaration

public static void assertPositive(int value) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from ww w  .  j  a va2s  .com*/
     * throws an IllegalArgumentException if the value is smaller then 0
     *
     *
     * @param value
     * @since 1.4
     */
    public static void assertPositive(int value) {
        if (value < 0) {
            throw new IllegalArgumentException("value is smaller then 0");
        }
    }
}

Related

  1. assertParameterWithinBounds(String name, long lower, long upper, long parameter)
  2. assertParameterWithinBounds(String name, long lower, long upper, long parameter)
  3. assertPasswordMeetsRequirements(String password, boolean expected)
  4. assertPositive(int num, String err)
  5. assertPositive(int val, String msg)
  6. assertPrecondition(boolean b)
  7. assertQualifiedString(String str, String argName)
  8. assertRange(String label, double value, double min, double max)
  9. assertRequiredArgs(Object[] methodArgs, int requiredArgs, String methodName)