com.github.davidmoten.aws.lw.client.internal.util.Preconditions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-lightweight-client-java Show documentation
Show all versions of aws-lightweight-client-java Show documentation
Lightweight client for all AWS services (but still with useful builders and XML parser)
The newest version!
package com.github.davidmoten.aws.lw.client.internal.util;
public final class Preconditions {
private Preconditions() {
// prevent instantiation
}
public static T checkNotNull(T t) {
return checkNotNull(t, "argument cannot be null");
}
public static T checkNotNull(T t, String message) {
if (t == null) {
throw new IllegalArgumentException(message);
}
return t;
}
public static void checkArgument(boolean b, String message) {
if (!b)
throw new IllegalArgumentException(message);
}
public static void checkArgument(boolean b) {
if (!b)
throw new IllegalArgumentException();
}
}