Class Assert
java.lang.Object
com.apple.foundationdb.relational.util.Assert
A set of helper methods for validating input, pre-conditions, ... etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S,
T> S castUnchecked
(T object, Class<S> clazz) static <S,
T> S castUnchecked
(T object, Class<S> clazz, ErrorCode errorCodeIfCastFailed, Supplier<String> messageSupplier) static RelationalException
fail()
static RelationalException
static RelationalException
static UncheckedRelationalException
static UncheckedRelationalException
failUnchecked
(ErrorCode failErrorCode, String failMessage) static UncheckedRelationalException
failUnchecked
(String failMessage) static void
static void
static void
static void
isNullUnchecked
(Object object) static void
isNullUnchecked
(Object object, ErrorCode errorCodeIfNotNull, String messageIfNotNull) static void
isNullUnchecked
(Object object, ErrorCode errorCodeIfNotNull, Supplier<String> messageSupplier) static void
isNullUnchecked
(Object object, String messageIfNotNull) static <T> T
notNull
(T object) static <T> T
static <T> T
static <T> T
notNullUnchecked
(T object) static <T> T
notNullUnchecked
(T object, ErrorCode errorCodeIfNull, String messageIfNull) static <T> T
notNullUnchecked
(T object, ErrorCode errorCodeIfNull, String messageTemplate, Object messageValue) static <T> T
notNullUnchecked
(T object, ErrorCode errorCodeIfNull, Supplier<String> messageSupplier) static <T> T
notNullUnchecked
(T object, String messageIfNull) static void
that
(boolean mustBeTrue) static void
static void
static void
that
(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageFormat, Object messageValue1, Object messageValue2) static void
static void
static void
thatUnchecked
(boolean mustBeTrue) static void
thatUnchecked
(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageIfNotTrue) static void
thatUnchecked
(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageTemplate, Object messageValue) static void
thatUnchecked
(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageTemplate, Object messageValue1, Object messageValue2) static void
thatUnchecked
(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, Supplier<String> messageSupplier) static void
thatUnchecked
(boolean mustBeTrue, String messageIfNotTrue)
-
Method Details
-
that
- Throws:
RelationalException
-
that
public static void that(boolean mustBeTrue, @Nonnull String messageIfNotTrue) throws RelationalException - Throws:
RelationalException
-
that
public static void that(boolean mustBeTrue, @Nonnull ErrorCode errorCodeIfNotTrue, @Nonnull Supplier<String> messageSupplier) throws RelationalException - Throws:
RelationalException
-
that
public static void that(boolean mustBeTrue, @Nonnull ErrorCode errorCodeIfNotTrue, @Nonnull String messageIfNotTrue) throws RelationalException - Throws:
RelationalException
-
that
public static void that(boolean mustBeTrue, @Nonnull ErrorCode errorCodeIfNotTrue, @Nonnull String messageFormat, @Nonnull Object messageValue) throws RelationalException - Throws:
RelationalException
-
that
public static void that(boolean mustBeTrue, @Nonnull ErrorCode errorCodeIfNotTrue, @Nonnull String messageFormat, @Nonnull Object messageValue1, @Nonnull Object messageValue2) throws RelationalException - Throws:
RelationalException
-
notNull
- Throws:
RelationalException
-
notNull
- Throws:
RelationalException
-
notNull
public static <T> T notNull(T object, @Nonnull ErrorCode errorCodeIfNotTrue, @Nonnull String messageIfNull) throws RelationalException - Throws:
RelationalException
-
isNull
- Throws:
RelationalException
-
isNull
- Throws:
RelationalException
-
isNull
public static void isNull(Object object, @Nonnull ErrorCode errorCodeIfNotTrue, @Nonnull String messageIfNull) throws RelationalException - Throws:
RelationalException
-
fail
- Throws:
RelationalException
-
fail
- Throws:
RelationalException
-
fail
public static RelationalException fail(@Nonnull ErrorCode failErrorCode, @Nonnull String failMessage) throws RelationalException - Throws:
RelationalException
-
thatUnchecked
public static void thatUnchecked(boolean mustBeTrue) -
thatUnchecked
-
thatUnchecked
-
thatUnchecked
-
thatUnchecked
-
thatUnchecked
-
notNullUnchecked
public static <T> T notNullUnchecked(T object) -
notNullUnchecked
-
notNullUnchecked
-
notNullUnchecked
-
notNullUnchecked
-
isNullUnchecked
-
isNullUnchecked
-
isNullUnchecked
-
isNullUnchecked
-
failUnchecked
-
failUnchecked
-
failUnchecked
public static UncheckedRelationalException failUnchecked(@Nonnull ErrorCode failErrorCode, @Nonnull String failMessage) -
castUnchecked
-
castUnchecked
-