Checks

public final class Checks


Substitute for Guava Preconditions to avoid guava as a dep.

Summary

Public constructors

Public methods

static void
checkArgument(boolean expression, Object errorMessage)
static void
checkArgument(
    boolean expression,
    String errorMessageTemplate,
    Object[] errorMessageArgs
)
static void
checkArgument(boolean expression)
static T
<T> checkNotNull(T reference, Object errorMessage)
static T
<T> checkNotNull(
    T reference,
    String errorMessageTemplate,
    Object[] errorMessageArgs
)
static T
<T> checkNotNull(T reference)
static void
checkState(boolean expression, Object errorMessage)
static void
checkState(
    boolean expression,
    String errorMessageTemplate,
    Object[] errorMessageArgs
)

Public constructors

Checks

public Checks()

Public methods

checkArgument

public static void checkArgument(boolean expression, Object errorMessage)

checkArgument

public static void checkArgument(
    boolean expression,
    String errorMessageTemplate,
    Object[] errorMessageArgs
)

checkArgument

public static void checkArgument(boolean expression)

checkNotNull

public static T <T> checkNotNull(T reference, Object errorMessage)

checkNotNull

public static T <T> checkNotNull(
    T reference,
    String errorMessageTemplate,
    Object[] errorMessageArgs
)

checkNotNull

public static T <T> checkNotNull(T reference)

checkState

public static void checkState(boolean expression, Object errorMessage)

checkState

public static void checkState(
    boolean expression,
    String errorMessageTemplate,
    Object[] errorMessageArgs
)