public class Argument extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
requireNonNull(T object,
String message)
Tests for null and throws
IllegalArgumentException when null. |
static void |
requirePositive(int amount,
String message)
Tests if the given integer is positive.
|
static void |
requireWithinBounds(int amount,
int lowerLimit,
int upperLimit,
String message)
Tests if the given amount is within the bounds.
|
public static <T> T requireNonNull(T object,
String message)
IllegalArgumentException when null.T - The typeobject - The object to test.message - The message when it is null.public static void requirePositive(int amount,
String message)
amount - The amount to test.message - The message when the amount is negative.public static void requireWithinBounds(int amount,
int lowerLimit,
int upperLimit,
String message)
amount - The amount to testlowerLimit - The lower limit (inclusive)upperLimit - The upper limit (exclusive)Copyright © 2016. All rights reserved.