8000 fix backward compatibility for #359 (#377) · jasync-sql/jasync-sql@3105565 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3105565

Browse files
authored
fix backward compatibility for #359 (#377)
1 parent d76b8ec commit 3105565

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

db-async-common/src/main/java/com/github/jasync/sql/db/Configuration.kt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,53 @@ class Configuration @JvmOverloads constructor(
124124
)
125125
}
126126

127+
@Deprecated(
128+
"backward compatibility for https://github.com/jasync-sql/jasync-sql/issues/359",
129+
ReplaceWith("copy()"),
130+
DeprecationLevel.ERROR,
131+
)
132+
fun copy(
133+
username: String? = null,
134+
host: String? = null,
135+
port: Int? = null,
136+
password: String? = null,
137+
database: String? = null,
138+
ssl: SSLConfiguration? = null,
139+
charset: Charset? = null,
140+
maximumMessageSize: Int,
141+
allocator: ByteBufAllocator? = null,
142+
connectionTimeout: Int,
143+
queryTimeout: Duration? = null,
144+
applicationName: String? = null,
145+
interceptors: List<Supplier<QueryInterceptor>>? = null,
146+
eventLoopGroup: EventLoopGroup? = null,
147+
executionContext: Executor? = null,
148+
currentSchema: String? = null,
149+
socketPath: String? = null,
150+
): Configuration {
151+
return Configuration(
152+
username = username ?: this.username,
153+
host = host ?: this.host,
154+
port = port ?: this.port,
155+
password = password ?: this.password,
156+
database = database ?: this.database,
157+
ssl = ssl ?: this.ssl,
158+
charset = charset ?: this.charset,
159+
maximumMessageSize = maximumMessageSize,
160+
allocator = allocator ?: this.allocator,
161+
connectionTimeout = connectionTimeout,
162+
queryTimeout = queryTimeout ?: this.queryTimeout,
163+
applicationName = applicationName ?: this.applicationName,
164+
interceptors = interceptors ?: this.interceptors,
165+
eventLoopGroup = eventLoopGroup ?: this.eventLoopGroup,
166+
executionContext = executionContext ?: this.executionContext,
167+
currentSchema = currentSchema ?: this.currentSchema,
168+
socketPath = socketPath ?: this.socketPath,
169+
credentialsProvider = this.credentialsProvider,
170+
rsaPublicKey = this.rsaPublicKey,
171+
)
172+
}
173+
127174
override fun equals(other: Any?): Boolean {
128175
if (this === other) return true
129176
if (javaClass != other?.javaClass) return false

0 commit comments

Comments
 (0)
0