Package org.a2aproject.sdk.util
Class Assert
java.lang.Object
org.a2aproject.sdk.util.Assert
Parameter validation utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TcheckNotNullParam(String name, @Nullable T value) Check that the named parameter is notnull.static voidisValidJsonRpcId(@Nullable Object value) Validates that the given value is a legal JSON-RPC id (null,String, orNumber).
-
Method Details
-
checkNotNullParam
@NotNull public static <T> T checkNotNullParam(String name, @Nullable T value) throws IllegalArgumentException Check that the named parameter is notnull. Use a standard exception message if it is.- Type Parameters:
T- the value type- Parameters:
name- the parameter namevalue- the parameter value- Returns:
- the value that was passed in
- Throws:
IllegalArgumentException- if the value isnull
-
isValidJsonRpcId
Validates that the given value is a legal JSON-RPC id (null,String, orNumber).- Parameters:
value- the id value to validate- Throws:
IllegalArgumentException- if the value is not a valid JSON-RPC id type
-