/** * Creates a new {@link RangeCommand} given a {@code key}. * * @param key must not be {@literal null}. * @return a new {@link RangeCommand} for {@code key}. */ public static RangeCommand key(ByteBuffer key) { return new RangeCommand(key, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@literal null} when used in pipeline / transaction. The position of the first bit set to 1 or 0 according * to the request. * @see <a href="http://redis.io/commands/bitpos">Redis Documentation: BITPOS</a> * @since 2.1 */ default Long bitPos(String key, boolean bit) { return bitPos(key, bit, org.springframework.data.domain.Range.unbounded()); }
/** * Creates a new {@link BitCountCommand} given a {@literal key}. * * @param key must not be {@literal null}. * @return a new {@link BitCountCommand} for a {@literal key}. */ public static BitCountCommand bitCount(ByteBuffer key) { Assert.notNull(key, "Key must not be null!"); return new BitCountCommand(key, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@link Mono} emitting result when ready. * @since 2.1 */ default Mono<Long> bitPos(ByteBuffer key, boolean bit) { return bitPos(key, bit, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@literal null} when used in pipeline / transaction. The position of the first bit set to 1 or 0 according * to the request. * @see <a href="http://redis.io/commands/bitpos">Redis Documentation: BITPOS</a> * @since 2.1 */ @Nullable default Long bitPos(byte[] key, boolean bit) { return bitPos(key, bit, Range.unbounded()); }
static BitPosCommand positionOf(boolean bit) { return new BitPosCommand(null, bit, Range.unbounded()); }
/** * Creates a new {@link RangeCommand} given a {@code key}. * * @param key must not be {@literal null}. * @return a new {@link RangeCommand} for {@code key}. */ public static RangeCommand stream(ByteBuffer key) { return new RangeCommand(key, Range.unbounded(), Limit.unlimited()); }
@Override public Flux<NumericResponse<BitCountCommand, Long>> bitCount(Publisher<BitCountCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Range<Long> range = command.getRange(); return (!Range.unbounded().equals(range) ? cmd.bitcount(command.getKey(), LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)) // : cmd.bitcount(command.getKey())).map(responseValue -> new NumericResponse<>(command, responseValue)); })); }
/** * Creates a new {@link BitCountCommand} given a {@literal key}. * * @param key must not be {@literal null}. * @return a new {@link BitCountCommand} for a {@literal key}. */ public static BitCountCommand bitCount(ByteBuffer key) { Assert.notNull(key, "Key must not be null!"); return new BitCountCommand(key, Range.unbounded()); }
/** * Creates a new {@link RangeCommand} given a {@code key}. * * @param key must not be {@literal null}. * @return a new {@link RangeCommand} for {@code key}. */ public static RangeCommand key(ByteBuffer key) { return new RangeCommand(key, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@link Mono} emitting result when ready. * @since 2.1 */ default Mono<Long> bitPos(ByteBuffer key, boolean bit) { return bitPos(key, bit, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@link Mono} emitting result when ready. * @since 2.1 */ default Mono<Long> bitPos(ByteBuffer key, boolean bit) { return bitPos(key, bit, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@literal null} when used in pipeline / transaction. The position of the first bit set to 1 or 0 according * to the request. * @see <a href="http://redis.io/commands/bitpos">Redis Documentation: BITPOS</a> * @since 2.1 */ default Long bitPos(String key, boolean bit) { return bitPos(key, bit, org.springframework.data.domain.Range.unbounded()); }
/** * Creates a new {@link RangeCommand} given a {@code key}. * * @param key must not be {@literal null}. * @return a new {@link RangeCommand} for {@code key}. */ public static RangeCommand key(ByteBuffer key) { return new RangeCommand(key, Range.unbounded()); }
/** * Creates a new {@link BitCountCommand} given a {@literal key}. * * @param key must not be {@literal null}. * @return a new {@link BitCountCommand} for a {@literal key}. */ public static BitCountCommand bitCount(ByteBuffer key) { Assert.notNull(key, "Key must not be null!"); return new BitCountCommand(key, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@literal null} when used in pipeline / transaction. The position of the first bit set to 1 or 0 according * to the request. * @see <a href="http://redis.io/commands/bitpos">Redis Documentation: BITPOS</a> * @since 2.1 */ @Nullable default Long bitPos(byte[] key, boolean bit) { return bitPos(key, bit, Range.unbounded()); }
/** * Return the position of the first bit set to given {@code bit} in a string. * * @param key the key holding the actual String. * @param bit the bit value to look for. * @return {@literal null} when used in pipeline / transaction. The position of the first bit set to 1 or 0 according * to the request. * @see <a href="http://redis.io/commands/bitpos">Redis Documentation: BITPOS</a> * @since 2.1 */ default Long bitPos(String key, boolean bit) { return bitPos(key, bit, org.springframework.data.domain.Range.unbounded()); }
static BitPosCommand positionOf(boolean bit) { return new BitPosCommand(null, bit, Range.unbounded()); }
@Override public Flux<NumericResponse<BitCountCommand, Long>> bitCount(Publisher<BitCountCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Range<Long> range = command.getRange(); return (!Range.unbounded().equals(range) ? cmd.bitcount(command.getKey(), LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)) // : cmd.bitcount(command.getKey())).map(responseValue -> new NumericResponse<>(command, responseValue)); })); }
@Override public Flux<NumericResponse<BitCountCommand, Long>> bitCount(Publisher<BitCountCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Range<Long> range = command.getRange(); return (!Range.unbounded().equals(range) ? cmd.bitcount(command.getKey(), LettuceConverters.getLowerBoundIndex(range), // LettuceConverters.getUpperBoundIndex(range)) // : cmd.bitcount(command.getKey())).map(responseValue -> new NumericResponse<>(command, responseValue)); })); }