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 RelationalExceptionfail()static RelationalExceptionstatic RelationalExceptionstatic UncheckedRelationalExceptionstatic UncheckedRelationalExceptionfailUnchecked(ErrorCode failErrorCode, String failMessage) static UncheckedRelationalExceptionfailUnchecked(String failMessage) static voidstatic voidstatic voidstatic voidisNullUnchecked(Object object) static voidisNullUnchecked(Object object, ErrorCode errorCodeIfNotNull, String messageIfNotNull) static voidisNullUnchecked(Object object, ErrorCode errorCodeIfNotNull, Supplier<String> messageSupplier) static voidisNullUnchecked(Object object, String messageIfNotNull) static <T> TnotNull(T object) static <T> Tstatic <T> Tstatic <T> TnotNullUnchecked(T object) static <T> TnotNullUnchecked(T object, ErrorCode errorCodeIfNull, String messageIfNull) static <T> TnotNullUnchecked(T object, ErrorCode errorCodeIfNull, String messageTemplate, Object messageValue) static <T> TnotNullUnchecked(T object, ErrorCode errorCodeIfNull, Supplier<String> messageSupplier) static <T> TnotNullUnchecked(T object, String messageIfNull) static <T> ToptionalUnchecked(Optional<T> optional, ErrorCode errorCodeIfOptionalEmpty, Supplier<String> messageSupplier) static <V> VoptionalUnchecked(Optional<V> optional) static voidthat(boolean mustBeTrue) static voidstatic voidstatic voidthat(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageFormat, Object messageValue1, Object messageValue2) static voidstatic voidstatic voidthatUnchecked(boolean mustBeTrue) static voidthatUnchecked(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageIfNotTrue) static voidthatUnchecked(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageTemplate, Object messageValue) static voidthatUnchecked(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, String messageTemplate, Object messageValue1, Object messageValue2) static voidthatUnchecked(boolean mustBeTrue, ErrorCode errorCodeIfNotTrue, Supplier<String> messageSupplier) static voidthatUnchecked(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
-
optionalUnchecked
-
optionalUnchecked
-