public class Preconditions extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkArgument(boolean condition,
Object argument) |
static void |
checkArgument(boolean condition,
String message) |
static void |
checkArgumentNotNull(Object reference,
String argumentName)
Throws
IllegalArgumentException with an appropriate message if the reference is null. |
static void |
checkNotNull(Object reference) |
public static void checkArgumentNotNull(Object reference, String argumentName)
IllegalArgumentException
with an appropriate message if the reference is null.reference
- the reference to be checkedargumentName
- name of the argument that is being checked. The name used in the error message.public static void checkNotNull(Object reference)
reference
- The reference to be checkedNullPointerException
- if the reference is nullpublic static void checkArgument(boolean condition, Object argument)
public static void checkArgument(boolean condition, String message)
Copyright © 2023. All rights reserved.