1 package com.github.davidmoten.aws.lw.client.internal.util;
2
3 public final class Preconditions {
4
5 private Preconditions() {
6
7 }
8
9 public static <T> T checkNotNull(T t) {
10 return checkNotNull(t, "argument cannot be null");
11 }
12
13 public static <T> T checkNotNull(T t, String message) {
14 if (t == null) {
15 throw new IllegalArgumentException(message);
16 }
17 return t;
18 }
19
20 public static void checkArgument(boolean b, String message) {
21 if (!b)
22 throw new IllegalArgumentException(message);
23 }
24
25 public static void checkArgument(boolean b) {
26 if (!b)
27 throw new IllegalArgumentException();
28 }
29
30 }