Class Assert

java.lang.Object
org.a2aproject.sdk.util.Assert

public final class Assert extends Object
Parameter validation utilities.
  • Method Details

    • checkNotNullParam

      @NotNull public static <T> T checkNotNullParam(String name, @Nullable T value) throws IllegalArgumentException
      Check that the named parameter is not null. Use a standard exception message if it is.
      Type Parameters:
      T - the value type
      Parameters:
      name - the parameter name
      value - the parameter value
      Returns:
      the value that was passed in
      Throws:
      IllegalArgumentException - if the value is null
    • isValidJsonRpcId

      public static void isValidJsonRpcId(@Nullable Object value)
      Validates that the given value is a legal JSON-RPC id (null, String, or Number).
      Parameters:
      value - the id value to validate
      Throws:
      IllegalArgumentException - if the value is not a valid JSON-RPC id type