/** * Remove {@literal value} from sorted set. Return number of removed elements. * * @param key must not be {@literal null}. * @param value must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrem">Redis Documentation: ZREM</a> */ default Mono<Long> zRem(ByteBuffer key, ByteBuffer value) { Assert.notNull(value, "Value must not be null!"); return zRem(key, Collections.singletonList(value)); }
/** * Remove {@literal values} from sorted set. Return number of removed elements. * * @param key must not be {@literal null}. * @param values must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrem">Redis Documentation: ZREM</a> */ default Mono<Long> zRem(ByteBuffer key, Collection<ByteBuffer> values) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(values, "Values must not be null!"); return zRem(Mono.just(ZRemCommand.values(values).from(key))).next().map(NumericResponse::getOutput); }
@Override @SuppressWarnings("unchecked") public Mono<Long> remove(K key, Object... values) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(values, "Values must not be null!"); if (values.length == 1) { return createMono(connection -> connection.zRem(rawKey(key), rawValue((V) values[0]))); } return createMono(connection -> Flux.fromArray((V[]) values) // .map(this::rawValue) // .collectList() // .flatMap(serialized -> connection.zRem(rawKey(key), serialized))); }
@Override @SafeVarargs public final Mono<Long> remove(K key, V... members) { Assert.notNull(key, "Key must not be null!"); Assert.notEmpty(members, "Members must not be null or empty!"); Assert.noNullElements(members, "Members must not contain null elements!"); return template.createMono(connection -> Flux.fromArray(members) // .map(this::rawValue) // .collectList() // .flatMap(serialized -> connection.zSetCommands().zRem(rawKey(key), serialized))); }
/** * Remove {@literal value} from sorted set. Return number of removed elements. * * @param key must not be {@literal null}. * @param value must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrem">Redis Documentation: ZREM</a> */ default Mono<Long> zRem(ByteBuffer key, ByteBuffer value) { Assert.notNull(value, "Value must not be null!"); return zRem(key, Collections.singletonList(value)); }
/** * Remove {@literal value} from sorted set. Return number of removed elements. * * @param key must not be {@literal null}. * @param value must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrem">Redis Documentation: ZREM</a> */ default Mono<Long> zRem(ByteBuffer key, ByteBuffer value) { Assert.notNull(value, "Value must not be null!"); return zRem(key, Collections.singletonList(value)); }
/** * Remove {@literal values} from sorted set. Return number of removed elements. * * @param key must not be {@literal null}. * @param values must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrem">Redis Documentation: ZREM</a> */ default Mono<Long> zRem(ByteBuffer key, Collection<ByteBuffer> values) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(values, "Values must not be null!"); return zRem(Mono.just(ZRemCommand.values(values).from(key))).next().map(NumericResponse::getOutput); }
/** * Remove {@literal values} from sorted set. Return number of removed elements. * * @param key must not be {@literal null}. * @param values must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrem">Redis Documentation: ZREM</a> */ default Mono<Long> zRem(ByteBuffer key, Collection<ByteBuffer> values) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(values, "Values must not be null!"); return zRem(Mono.just(ZRemCommand.values(values).from(key))).next().map(NumericResponse::getOutput); }
@Override @SuppressWarnings("unchecked") public Mono<Long> remove(K key, Object... values) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(values, "Values must not be null!"); if (values.length == 1) { return createMono(connection -> connection.zRem(rawKey(key), rawValue((V) values[0]))); } return createMono(connection -> Flux.fromArray((V[]) values) // .map(this::rawValue) // .collectList() // .flatMap(serialized -> connection.zRem(rawKey(key), serialized))); }
@Override @SuppressWarnings("unchecked") public Mono<Long> remove(K key, Object... values) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(values, "Values must not be null!"); if (values.length == 1) { return createMono(connection -> connection.zRem(rawKey(key), rawValue((V) values[0]))); } return createMono(connection -> Flux.fromArray((V[]) values) // .map(this::rawValue) // .collectList() // .flatMap(serialized -> connection.zRem(rawKey(key), serialized))); }
@Override @SafeVarargs public final Mono<Long> remove(K key, V... members) { Assert.notNull(key, "Key must not be null!"); Assert.notEmpty(members, "Members must not be null or empty!"); Assert.noNullElements(members, "Members must not contain null elements!"); return template.createMono(connection -> Flux.fromArray(members) // .map(this::rawValue) // .collectList() // .flatMap(serialized -> connection.zSetCommands().zRem(rawKey(key), serialized))); }
@Override @SafeVarargs public final Mono<Long> remove(K key, V... members) { Assert.notNull(key, "Key must not be null!"); Assert.notEmpty(members, "Members must not be null or empty!"); Assert.noNullElements(members, "Members must not contain null elements!"); return template.createMono(connection -> Flux.fromArray(members) // .map(this::rawValue) // .collectList() // .flatMap(serialized -> connection.zSetCommands().zRem(rawKey(key), serialized))); }