public final class Preconditions
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static @NotNull java.lang.String |
checkNotEmpty(@UnknownNullability java.lang.String string,
@NotNull java.lang.String replacement) |
static boolean |
checkNotNull(@UnknownNullability java.lang.Object object,
@NotNull java.lang.String message) |
static boolean |
checkState(boolean expression,
@NotNull java.lang.String message) |
static <T extends java.lang.annotation.Annotation> |
mustGetAnnotation(@NotNull java.lang.reflect.AnnotatedElement annotatedElement,
@NotNull java.lang.Class<T> annotationClass) |
static <O,T> T |
runOrDefault(O object,
T defaultValue,
@NotNull java.util.function.Function<O,T> function) |
@NotNull
public static <T extends java.lang.annotation.Annotation> T mustGetAnnotation(@NotNull
@NotNull java.lang.reflect.AnnotatedElement annotatedElement,
@NotNull
@NotNull java.lang.Class<T> annotationClass)
@Contract(value="null, _ -> fail")
public static boolean checkNotNull(@UnknownNullability java.lang.Object object,
@NotNull
@NotNull java.lang.String message)
@Contract(value="false, _ -> fail")
public static boolean checkState(boolean expression,
@NotNull
@NotNull java.lang.String message)
@NotNull
public static @NotNull java.lang.String checkNotEmpty(@UnknownNullability java.lang.String string,
@NotNull
@NotNull java.lang.String replacement)
@NotNull
public static <O,T> T runOrDefault(O object,
@NotNull
T defaultValue,
@NotNull
@NotNull java.util.function.Function<O,T> function)