# Package com.thetransactioncompany.jsonrpc2.util

Utility classes for typed retrieval of JSON-RPC 2.0 request parameters on the server side.

See: Description

- Class Summary
  Class | Description
  --- | ---
  NamedParamsRetriever | Utility class for retrieving JSON-RPC 2.0 named parameters (key-value pairs packed into a JSON Object).
  ParamsRetriever | The base abstract class for the JSON-RPC 2.0 parameter retrievers.
  PositionalParamsRetriever | Utility class for retrieving JSON-RPC 2.0 positional parameters (packed into a JSON Array).

## Package com.thetransactioncompany.jsonrpc2.util Description

Utility classes for typed retrieval of JSON-RPC 2.0 request parameters on the server side.

The following parameter type conversion choices are available:

- JSON true/false to Java `boolean`
- JSON number to Java `int`, `long`, `float` or `double`
- JSON string to `java.lang.String`
- Predefined (enumerated) JSON string to a Java `enum` constant or `java.lang.String`
- JSON array to Java `boolean[]`, `int[]`, `long[]`, `float[]`, `double[]` or `string[]` array, or to mixed type `java.util.List`
- JSON object to `java.util.Map`

If a parameter cannot be retrieved, either because it's missing or is of the wrong type, a standard `JSONRPC2Error.INVALID_PARAMS` exception is thrown.

There are two concrete classes:

- The `PositionalParamsRetriever` class is for extracting positional parameters (packed in a JSON array).
- The `NamedParamsRetriever` class is for extracting named parameters (packed in a JSON object).

Package dependencies: The classes in this package depend on the sister `com.thetransactioncompany.jsonrpc2` package.