Class Assert
java.lang.Object
io.r2dbc.proxy.util.Assert
Assertion library for the implementation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TrequireNonNull(T t, String message) Checks that a specified object reference is notnulland throws a customizedIllegalArgumentExceptionif it is.static <T> TrequireType(Object value, Class<T> type, String message) Checks that the specified value is of a specific type.
-
Method Details
-
requireNonNull
Checks that a specified object reference is notnulland throws a customizedIllegalArgumentExceptionif it is.- Type Parameters:
T- the type of the reference- Parameters:
t- the object reference to check for nullitymessage- the detail message to be used in the event that anIllegalArgumentExceptionis thrown- Returns:
tif notnull- Throws:
IllegalArgumentException- iftis {code null}
-
requireType
Checks that the specified value is of a specific type.- Type Parameters:
T- the type being required- Parameters:
value- the value to checktype- the type to requiremessage- the message to use in exception if type is not as required- Returns:
- the value casted to the required type
- Throws:
IllegalArgumentException- ifvalueis not of the required typeIllegalArgumentException- ifvalue,type, ormessageisnull
-