public final class ShardingSpherePreconditions extends Object
| Constructor and Description |
|---|
ShardingSpherePreconditions() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Throwable> |
checkNotNull(Object reference,
Supplier<T> exceptionSupplierIfUnexpected)
Ensures that an object reference passed as a parameter to the calling method is not null.
|
static <T extends Throwable> |
checkState(boolean expectedExpression,
Supplier<T> exceptionSupplierIfUnexpected)
Ensures the truth of an expression involving the state of the calling instance.
|
public static <T extends Throwable> void checkState(boolean expectedExpression, Supplier<T> exceptionSupplierIfUnexpected) throws T extends Throwable
T - type of exceptionexpectedExpression - expected expressionexceptionSupplierIfUnexpected - exception from this supplier will be thrown if expression is unexpectedT - exception to be thrownT extends Throwablepublic static <T extends Throwable> void checkNotNull(Object reference, Supplier<T> exceptionSupplierIfUnexpected) throws T extends Throwable
T - type of exceptionreference - object reference to be checkedexceptionSupplierIfUnexpected - exception from this supplier will be thrown if expression is unexpectedT - exception to be thrownT extends ThrowableCopyright © 2023 The Apache Software Foundation. All rights reserved.