org.springframework.data.redis.core.SetOperations.distinctRandomMembers()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中org.springframework.data.redis.core.SetOperations.distinctRandomMembers()方法的一些代码示例,展示了SetOperations.distinctRandomMembers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SetOperations.distinctRandomMembers()方法的具体详情如下:
包路径:org.springframework.data.redis.core.SetOperations
类名称:SetOperations
方法名:distinctRandomMembers

SetOperations.distinctRandomMembers介绍

[英]Get count distinct random elements from set at key.
[中]从set at key中获取不同的随机元素计数。

代码示例

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Set<V> distinctRandomMembers(long count) {
  return ops.distinctRandomMembers(getKey(), count);
}

代码示例来源:origin: whvcse/EasyWeb

/**
 * 随机获取集合中count个元素并且去除重复的
 *
 * @param key
 * @param count
 * @return
 */
public Set<String> sDistinctRandomMembers(String key, long count) {
  return redisTemplate.opsForSet().distinctRandomMembers(key, count);
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Set<V> distinctRandomMembers(long count) {
  return ops.distinctRandomMembers(getKey(), count);
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Set<V> distinctRandomMembers(long count) {
  return ops.distinctRandomMembers(getKey(), count);
}

相关文章