Tabnine Logo
RedisZSetCommands$Tuple.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.springframework.data.redis.connection.RedisZSetCommands$Tuple

Best Java code snippets using org.springframework.data.redis.connection.RedisZSetCommands$Tuple.getValue (Showing top 20 results out of 315)

origin: redisson/redisson

@Override
public Long zAdd(byte[] key, Set<Tuple> tuples) {
  List<Object> params = new ArrayList<Object>(tuples.size()*2+1);
  params.add(key);
  for (Tuple entry : tuples) {
    params.add(BigDecimal.valueOf(entry.getScore()).toPlainString());
    params.add(entry.getValue());
  }
  return write(key, StringCodec.INSTANCE, RedisCommands.ZADD, params.toArray());
}
origin: redisson/redisson

@Override
public Long zAdd(byte[] key, Set<Tuple> tuples) {
  List<Object> params = new ArrayList<Object>(tuples.size()*2+1);
  params.add(key);
  for (Tuple entry : tuples) {
    params.add(BigDecimal.valueOf(entry.getScore()).toPlainString());
    params.add(entry.getValue());
  }
  return write(key, StringCodec.INSTANCE, RedisCommands.ZADD, params.toArray());
}
origin: redisson/redisson

@Override
public Long zAdd(byte[] key, Set<Tuple> tuples) {
  List<Object> params = new ArrayList<Object>(tuples.size()*2+1);
  params.add(key);
  for (Tuple entry : tuples) {
    params.add(BigDecimal.valueOf(entry.getScore()).toPlainString());
    params.add(entry.getValue());
  }
  return write(key, StringCodec.INSTANCE, RedisCommands.ZADD, params.toArray());
}
origin: org.springframework.data/spring-data-redis

public static List<Object> toObjects(Set<Tuple> tuples) {
  List<Object> tupleArgs = new ArrayList<>(tuples.size() * 2);
  for (Tuple tuple : tuples) {
    tupleArgs.add(tuple.getScore());
    tupleArgs.add(tuple.getValue());
  }
  return tupleArgs;
}
origin: org.springframework.data/spring-data-redis

/**
 * Constructs a new <code>DefaultStringTuple</code> instance.
 *
 * @param tuple
 * @param valueAsString
 */
public DefaultStringTuple(Tuple tuple, String valueAsString) {
  super(tuple.getValue(), tuple.getScore());
  this.valueAsString = valueAsString;
}
origin: spring-projects/spring-data-redis

return cmd.zaddincr(command.getKey(), tuple.getScore(), ByteBuffer.wrap(tuple.getValue()))
    .map(value -> new NumericResponse<>(command, value));
.map(tuple -> ScoredValue.fromNullable(tuple.getScore(), ByteBuffer.wrap(tuple.getValue())))
.toArray(ScoredValue[]::new);
origin: spring-projects/spring-data-redis

/**
 * Map a {@link Set} of {@link Tuple} by {@code value} to its {@code score}.
 *
 * @param tuples must not be {@literal null}.
 * @return
 * @since 2.0
 */
public static Map<byte[], Double> toTupleMap(Set<Tuple> tuples) {
  Assert.notNull(tuples, "Tuple set must not be null!");
  Map<byte[], Double> args = new LinkedHashMap<>(tuples.size(), 1);
  Set<Double> scores = new HashSet<>(tuples.size(), 1);
  boolean isAtLeastJedis24 = JedisVersionUtil.atLeastJedis24();
  for (Tuple tuple : tuples) {
    if (!isAtLeastJedis24) {
      if (scores.contains(tuple.getScore())) {
        throw new UnsupportedOperationException(
            "Bulk add of multiple elements with the same score is not supported. Add the elements individually.");
      }
      scores.add(tuple.getScore());
    }
    args.put(tuple.getValue(), tuple.getScore());
  }
  return args;
}
origin: spring-projects/spring-data-redis

/**
 * Get elements in {@literal range} from sorted set.
 *
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @param limit must not be {@literal null}.
 * @return
 * @see <a href="http://redis.io/commands/zrangebyscore">Redis Documentation: ZRANGEBYSCORE</a>
 */
default Flux<ByteBuffer> zRangeByScore(ByteBuffer key, Range<Double> range, Limit limit) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range must not be null!");
  Assert.notNull(limit, "Limit must not be null!");
  return zRangeByScore(Mono.just(ZRangeByScoreCommand.scoresWithin(range).from(key).limitTo(limit))) //
      .flatMap(CommandResponse::getOutput) //
      .map(tuple -> ByteBuffer.wrap(tuple.getValue()));
}
origin: spring-projects/spring-data-redis

/**
 * Get elements in {@literal range} from sorted set in reverse {@literal score} ordering.
 *
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @param limit must not be {@literal null}.
 * @return
 * @see <a href="http://redis.io/commands/zrevrangebyscore">Redis Documentation: ZREVRANGEBYSCORE</a>
 */
default Flux<ByteBuffer> zRevRangeByScore(ByteBuffer key, Range<Double> range, Limit limit) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range must not be null!");
  Assert.notNull(limit, "Limit must not be null!");
  return zRangeByScore(Mono.just(ZRangeByScoreCommand.reverseScoresWithin(range).from(key).limitTo(limit))) //
      .flatMap(CommandResponse::getOutput) //
      .map(tuple -> ByteBuffer.wrap(tuple.getValue()));
}
origin: spring-projects/spring-data-redis

/**
 * Get elements in {@literal range} from sorted set.
 *
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @return
 * @see <a href="http://redis.io/commands/zrangebyscore">Redis Documentation: ZRANGEBYSCORE</a>
 */
default Flux<ByteBuffer> zRangeByScore(ByteBuffer key, Range<Double> range) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range must not be null!");
  return zRangeByScore(Mono.just(ZRangeByScoreCommand.scoresWithin(range).from(key))) //
      .flatMap(CommandResponse::getOutput) //
      .map(tuple -> ByteBuffer.wrap(tuple.getValue()));
}
origin: spring-projects/spring-data-redis

/**
 * Get elements in {@literal range} from sorted set in reverse {@literal score} ordering.
 *
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @return
 * @see <a href="http://redis.io/commands/zrevrangebyscore">Redis Documentation: ZREVRANGEBYSCORE</a>
 */
default Flux<ByteBuffer> zRevRangeByScore(ByteBuffer key, Range<Double> range) {
  Assert.notNull(key, "Key must not be null!");
  return zRangeByScore(Mono.just(ZRangeByScoreCommand.reverseScoresWithin(range).from(key))) //
      .flatMap(CommandResponse::getOutput) //
      .map(tuple -> ByteBuffer.wrap(tuple.getValue()));
}
origin: spring-projects/spring-data-redis

  public StringTuple convert(Tuple source) {
    return new DefaultStringTuple(source, serializer.deserialize(source.getValue()));
  }
}
origin: spring-projects/spring-data-redis

/**
 * Constructs a new <code>DefaultStringTuple</code> instance.
 *
 * @param tuple
 * @param valueAsString
 */
public DefaultStringTuple(Tuple tuple, String valueAsString) {
  super(tuple.getValue(), tuple.getScore());
  this.valueAsString = valueAsString;
}
origin: spring-projects/spring-data-redis

public static List<Object> toObjects(Set<Tuple> tuples) {
  List<Object> tupleArgs = new ArrayList<>(tuples.size() * 2);
  for (Tuple tuple : tuples) {
    tupleArgs.add(tuple.getScore());
    tupleArgs.add(tuple.getValue());
  }
  return tupleArgs;
}
origin: spring-projects/spring-data-redis

/**
 * Get elements in {@literal range} from sorted set.
 *
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @return
 * @see <a href="http://redis.io/commands/zrange">Redis Documentation: ZRANGE</a>
 */
default Flux<ByteBuffer> zRange(ByteBuffer key, Range<Long> range) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range must not be null!");
  return zRange(Mono.just(ZRangeCommand.valuesWithin(range).from(key))) //
      .flatMap(CommandResponse::getOutput).map(tuple -> ByteBuffer.wrap(tuple.getValue()));
}
origin: spring-projects/spring-data-redis

/**
 * Get elements in {@literal range} from sorted set in reverse {@literal score} ordering.
 *
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @return
 * @see <a href="http://redis.io/commands/zrevrange">Redis Documentation: ZREVRANGE</a>
 */
default Flux<ByteBuffer> zRevRange(ByteBuffer key, Range<Long> range) {
  Assert.notNull(key, "Key must not be null!");
  return zRange(Mono.just(ZRangeCommand.reverseValuesWithin(range).from(key))).flatMap(CommandResponse::getOutput)
      .map(tuple -> ByteBuffer.wrap(tuple.getValue()));
}
origin: spring-projects/spring-data-redis

  private TypedTuple<V> readTypedTuple(Tuple raw) {
    return new DefaultTypedTuple<>(readValue(ByteBuffer.wrap(raw.getValue())), raw.getScore());
  }
}
origin: spring-projects/spring-data-redis

@SuppressWarnings({ "unchecked", "rawtypes" })
TypedTuple<V> deserializeTuple(Tuple tuple) {
  Object value = tuple.getValue();
  if (valueSerializer() != null) {
    value = valueSerializer().deserialize(tuple.getValue());
  }
  return new DefaultTypedTuple(value, tuple.getScore());
}
origin: spring-projects/spring-data-redis

@SuppressWarnings({ "unchecked", "rawtypes" })
private Set<TypedTuple<V>> convertTupleValues(Set<Tuple> rawValues, @Nullable RedisSerializer valueSerializer) {
  Set<TypedTuple<V>> set = new LinkedHashSet<>(rawValues.size());
  for (Tuple rawValue : rawValues) {
    Object value = rawValue.getValue();
    if (valueSerializer != null) {
      value = valueSerializer.deserialize(rawValue.getValue());
    }
    set.add(new DefaultTypedTuple(value, rawValue.getScore()));
  }
  return set;
}
origin: redisson/redisson

@Override
public Long zAdd(byte[] key, Set<Tuple> tuples) {
  List<Object> params = new ArrayList<Object>(tuples.size()*2+1);
  params.add(key);
  for (Tuple entry : tuples) {
    params.add(BigDecimal.valueOf(entry.getScore()).toPlainString());
    params.add(entry.getValue());
  }
  return write(key, StringCodec.INSTANCE, RedisCommands.ZADD, params.toArray());
}
org.springframework.data.redis.connectionRedisZSetCommands$TuplegetValue

Popular methods of RedisZSetCommands$Tuple

  • getScore

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Notification (javax.management)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now