public final class Checks


Substitute for Guava Preconditions to avoid dependency.

Summary

Public methods

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

Public methods

checkArgument

public static void checkArgument(boolean expression)

checkArgument

public static void checkArgument(boolean expression, Object errorMessage)

checkArgument

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

checkNotNull

public static T <T> checkNotNull(T reference)

checkNotNull

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

checkNotNull

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

checkState

public static void checkState(boolean expression, Object errorMessage)

checkState

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