Java Assert assertParameterWithinBounds(String name, long lower, long upper, long parameter)

Here you can find the source of assertParameterWithinBounds(String name, long lower, long upper, long parameter)

Description

assert Parameter Within Bounds

License

Apache License

Declaration

public static void assertParameterWithinBounds(String name, long lower, long upper, long parameter) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void assertParameterWithinBounds(String name, long lower, long upper, long parameter) {
        if (parameter < lower || parameter > upper) {
            throw new IllegalArgumentException(
                    String.format("Invalid %s: %d (expected: %d <= n < %d)", name, parameter, lower, upper + 1));
        }//from w w w  .j  a v a 2  s.c o m
    }
}

Related

  1. assertOid(final String s)
  2. assertOneBitMask(long mask)
  3. assertParameter(Class expectedClass, Object[] params, int index)
  4. assertParameterInRange(long param, long lower, long upper)
  5. assertParameterWithinBounds(String name, long lower, long upper, long parameter)
  6. assertPasswordMeetsRequirements(String password, boolean expected)
  7. assertPositive(int num, String err)
  8. assertPositive(int val, String msg)
  9. assertPositive(int value)