Codota Logo
RedisZSetCommands$Tuple.getValue
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
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: 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

/**
 * 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

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

@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

  public StringTuple convert(Tuple source) {
    return new DefaultStringTuple(source, serializer.deserialize(source.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

/**
 * 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}.
 * @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}.
 * @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

@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: 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

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: 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

/**
 * 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;
}
org.springframework.data.redis.connectionRedisZSetCommands$TuplegetValue

Popular methods of RedisZSetCommands$Tuple

  • getScore

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • JButton (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now