public final class DriverInfo extends Object implements Serializable
This class is used to identify the client library and any upstream drivers (such as Spring Data Redis or Spring Session) when
connecting to Redis. The information is sent via the CLIENT SETINFO command.
The formatted name follows the pattern: name(driver1_vVersion1;driver2_vVersion2)
RedisURI.setDriverInfo(DriverInfo),
RedisURI.getDriverInfo(),
CLIENT SETINFO,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
DriverInfo.Builder
Builder for creating
DriverInfo instances. |
| Modifier and Type | Method and Description |
|---|---|
static DriverInfo.Builder |
builder()
Creates a new
DriverInfo.Builder with default values. |
static DriverInfo.Builder |
builder(DriverInfo driverInfo)
Creates a new
DriverInfo.Builder initialized with values from an existing DriverInfo. |
String |
getFormattedName()
Returns the formatted name including upstream drivers.
|
String |
getName()
Returns the base library name without upstream driver information.
|
String |
toString() |
public static DriverInfo.Builder builder()
DriverInfo.Builder with default values.
The default name is "Lettuce" (from LettuceVersion.getName()).
public static DriverInfo.Builder builder(DriverInfo driverInfo)
DriverInfo.Builder initialized with values from an existing DriverInfo.driverInfo - the existing driver info to copy from, must not be nullIllegalArgumentException - if driverInfo is nullpublic String getFormattedName()
If no upstream drivers are present, returns just the name. Otherwise, returns the name followed by upstream drivers in parentheses, separated by semicolons.
Examples:
"Lettuce" - no upstream drivers"Lettuce(spring-data-redis_v3.2.0)" - one upstream driver"Lettuce(spring-session_v3.3.0;spring-data-redis_v3.2.0)" - multiple upstream driverspublic String getName()
Copyright © 2026 lettuce.io. All rights reserved.