/** * Rename key {@literal oleName} to {@literal newName} only if {@literal newName} does not exist. * * @param key must not be {@literal null}. * @param newName must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/renamenx">Redis Documentation: RENAMENX</a> */ default Mono<Boolean> renameNX(ByteBuffer key, ByteBuffer newName) { Assert.notNull(key, "Key must not be null!"); return renameNX(Mono.just(RenameCommand.key(key).to(newName))).next().map(BooleanResponse::getOutput); }
@Override public Mono<Boolean> renameIfAbsent(K oldKey, K newKey) { Assert.notNull(oldKey, "Old key must not be null!"); Assert.notNull(newKey, "New Key must not be null!"); return createMono(connection -> connection.keyCommands().renameNX(rawKey(oldKey), rawKey(newKey))); }
/** * Rename key {@literal oleName} to {@literal newName} only if {@literal newName} does not exist. * * @param key must not be {@literal null}. * @param newName must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/renamenx">Redis Documentation: RENAMENX</a> */ default Mono<Boolean> renameNX(ByteBuffer key, ByteBuffer newName) { Assert.notNull(key, "Key must not be null!"); return renameNX(Mono.just(RenameCommand.key(key).to(newName))).next().map(BooleanResponse::getOutput); }
/** * Rename key {@literal oleName} to {@literal newName} only if {@literal newName} does not exist. * * @param key must not be {@literal null}. * @param newName must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/renamenx">Redis Documentation: RENAMENX</a> */ default Mono<Boolean> renameNX(ByteBuffer key, ByteBuffer newName) { Assert.notNull(key, "Key must not be null!"); return renameNX(Mono.just(RenameCommand.key(key).to(newName))).next().map(BooleanResponse::getOutput); }
@Override public Mono<Boolean> renameIfAbsent(K oldKey, K newKey) { Assert.notNull(oldKey, "Old key must not be null!"); Assert.notNull(newKey, "New Key must not be null!"); return createMono(connection -> connection.keyCommands().renameNX(rawKey(oldKey), rawKey(newKey))); }
@Override public Mono<Boolean> renameIfAbsent(K oldKey, K newKey) { Assert.notNull(oldKey, "Old key must not be null!"); Assert.notNull(newKey, "New Key must not be null!"); return createMono(connection -> connection.keyCommands().renameNX(rawKey(oldKey), rawKey(newKey))); }