public final class DriverInfo
extends java.lang.Object
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)
ClientSetInfoConfig,
CLIENT SETINFO| 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. |
java.lang.String |
getFormattedName()
Returns the formatted name including upstream drivers or legacy suffix.
|
java.lang.String |
getName()
Returns the base library name without upstream driver information.
|
java.lang.String |
getUpstreamDrivers()
Returns the formatted upstream drivers string (without the base library name).
|
java.lang.String |
toString() |
public static DriverInfo.Builder builder()
DriverInfo.Builder with default values.
The default name is "Jedis" (from JedisMetaInfo.getArtifactId()).
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 nullJedisValidationException - if driverInfo is nullpublic java.lang.String getFormattedName()
If a legacy suffix is set, returns the name followed by the suffix in parentheses. Otherwise, if upstream drivers are present, returns the name followed by upstream drivers in parentheses, separated by semicolons. If neither is set, returns just the name.
Examples:
"jedis" - no upstream drivers or suffix"jedis(my-suffix)" - legacy suffix mode"jedis(spring-data-redis_v3.2.0)" - one upstream driver"jedis(spring-session_v3.3.0;spring-data-redis_v3.2.0)" - multiple upstream
driverspublic java.lang.String getName()
public java.lang.String getUpstreamDrivers()
Multiple drivers are separated by semicolons, with the most recently added driver appearing first.
Examples:
"spring-data-redis_v3.2.0" - single upstream driver"spring-session_v3.3.0;spring-data-redis_v3.2.0" - multiple upstream driversnull if no upstream drivers are setpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2025. All rights reserved.