@@ -178,13 +178,13 @@ default Flux<ByteBuffer> scan() {
178
178
*/
179
179
class RenameCommand extends KeyCommand {
180
180
181
- private @ Nullable ByteBuffer newName ;
181
+ private @ Nullable ByteBuffer newKey ;
182
182
183
- private RenameCommand (ByteBuffer key , @ Nullable ByteBuffer newName ) {
183
+ private RenameCommand (ByteBuffer key , @ Nullable ByteBuffer newKey ) {
184
184
185
185
super (key );
186
186
187
- this .newName = newName ;
187
+ this .newKey = newKey ;
188
188
}
189
189
190
190
/**
@@ -201,44 +201,55 @@ public static RenameCommand key(ByteBuffer key) {
201
201
}
202
202
203
203
/**
204
- * Applies the {@literal newName }. Constructs a new command instance with all previously configured properties.
204
+ * Applies the {@literal newKey }. Constructs a new command instance with all previously configured properties.
205
205
*
206
- * @param newName must not be {@literal null}.
207
- * @return a new {@link RenameCommand} with {@literal newName } applied.
206
+ * @param newKey must not be {@literal null}.
207
+ * @return a new {@link RenameCommand} with {@literal newKey } applied.
208
208
*/
209
- public RenameCommand to (ByteBuffer newName ) {
209
+ public RenameCommand to (ByteBuffer newKey ) {
210
210
211
- Assert .notNull (newName , "New name must not be null!" );
211
+ Assert .notNull (newKey , "New key name must not be null!" );
212
212
213
- return new RenameCommand (getKey (), newName );
213
+ return new RenameCommand (getKey (), newKey );
214
214
}
215
215
216
216
/**
217
217
* @return can be {@literal null}.
218
+ * @deprecated since 2.5.7, renamed to {@link #getNewKey()}.
218
219
*/
219
220
@ Nullable
221
+ @ Deprecated
220
222
public ByteBuffer getNewName () {
221
- return newName ;
223
+ return newKey ;
224
+ }
225
+
226
+ /**
227
+ * @return can be {@literal null}.
228
+ * @since 2.5.7
229
+ */
230
+ @ Nullable
231
+ public ByteBuffer getNewKey () {
232
+ return newKey ;
222
233
}
223
234
}
224
235
225
236
/**
226
- * Rename key {@literal oleName } to {@literal newName }.
237
+ * Rename key {@literal oldKey } to {@literal newKey }.
227
238
*
228
- * @param key must not be {@literal null}.
229
- * @param newName must not be {@literal null}.
239
+ * @param oldKey must not be {@literal null}.
240
+ * @param newKey must not be {@literal null}.
230
241
* @return
231
242
* @see <a href="https://redis.io/commands/rename">Redis Documentation: RENAME</a>
232
243
*/
233
- default Mono <Boolean > rename (ByteBuffer key , ByteBuffer newName ) {
244
+ default Mono <Boolean > rename (ByteBuffer oldKey , ByteBuffer newKey ) {
234
245
235
- Assert .notNull (key , "Key must not be null!" );
246
+ Assert .notNull (oldKey , "Key must not be null!" );
236
247
237
- return rename (Mono .just (RenameCommand .key (key ).to (newName ))).next ().map (BooleanResponse ::getOutput );
248
+ return rename (Mono .just (RenameCommand .key (oldKey ).to (newKey ))).next ().map (BooleanResponse ::getOutput );
238
249
}
239
250
240
251
/**
241
- * Rename key {@literal oleName } to {@literal newName }.
252
+ * Rename key {@literal oldKey } to {@literal newKey }.
242
253
*
243
254
* @param command must not be {@literal null}.
244
255
* @return
@@ -247,22 +258,22 @@ default Mono<Boolean> rename(ByteBuffer key, ByteBuffer newName) {
247
258
Flux <BooleanResponse <RenameCommand >> rename (Publisher <RenameCommand > command );
248
259
249
260
/**
250
- * Rename key {@literal oleName } to {@literal newName } only if {@literal newName } does not exist.
261
+ * Rename key {@literal oldKey } to {@literal newKey } only if {@literal newKey } does not exist.
251
262
*
252
263
* @param key must not be {@literal null}.
253
- * @param newName must not be {@literal null}.
264
+ * @param newKey must not be {@literal null}.
254
265
* @return
255
266
* @see <a href="https://redis.io/commands/renamenx">Redis Documentation: RENAMENX</a>
256
267
*/
257
- default Mono <Boolean > renameNX (ByteBuffer key , ByteBuffer newName ) {
268
+ default Mono <Boolean > renameNX (ByteBuffer key , ByteBuffer newKey ) {
258
269
259
270
Assert .notNull (key , "Key must not be null!" );
260
271
261
- return renameNX (Mono .just (RenameCommand .key (key ).to (newName ))).next ().map (BooleanResponse ::getOutput );
272
+ return renameNX (Mono .just (RenameCommand .key (key ).to (newKey ))).next ().map (BooleanResponse ::getOutput );
262
273
}
263
274
264
275
/**
265
- * Rename key {@literal oleName } to {@literal newName } only if {@literal newName } does not exist.
276
+ * Rename key {@literal oldKey } to {@literal newKey } only if {@literal newKey } does not exist.
266
277
*
267
278
* @param command must not be {@literal null}.
268
279
* @return
0 commit comments