本文整理了Java中redis.clients.jedis.params.sortedset.ZAddParams.contains()
方法的一些代码示例,展示了ZAddParams.contains()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZAddParams.contains()
方法的具体详情如下:
包路径:redis.clients.jedis.params.sortedset.ZAddParams
类名称:ZAddParams
方法名:contains
暂无
代码示例来源:origin: sohutv/cachecloud
public byte[][] getByteParams(byte[] key, byte[]... args) {
ArrayList<byte[]> byteParams = new ArrayList<byte[]>();
byteParams.add(key);
if (contains(NX)) {
byteParams.add(SafeEncoder.encode(NX));
}
if (contains(XX)) {
byteParams.add(SafeEncoder.encode(XX));
}
if (contains(CH)) {
byteParams.add(SafeEncoder.encode(CH));
}
for (byte[] arg : args) {
byteParams.add(arg);
}
return byteParams.toArray(new byte[byteParams.size()][]);
}
代码示例来源:origin: Netflix/conductor
@Override
public Long zadd(String key, double score, String member, ZAddParams params) {
try {
if(params.contains("xx")) {
Double existing = redis.zscore(key, member);
if(existing == null) {
return 0L;
}
return redis.zadd(key, new ZsetPair(member, score));
}else {
return redis.zadd(key, new ZsetPair(member, score));
}
} catch (Exception e) {
throw new JedisException(e);
}
}
代码示例来源:origin: Netflix/conductor
@Override
public Long zadd(String key, double score, String member, ZAddParams params) {
try {
if(params.contains("xx")) {
Double existing = redis.zscore(key, member);
if(existing == null) {
return 0L;
}
return redis.zadd(key, new ZsetPair(member, score));
}else {
return redis.zadd(key, new ZsetPair(member, score));
}
} catch (Exception e) {
throw new JedisException(e);
}
}
代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence
@Override
public Long zadd(String key, double score, String member, ZAddParams params) {
try {
if(params.contains("xx")) {
Double existing = redis.zscore(key, member);
if(existing == null) {
return 0L;
}
return redis.zadd(key, new ZsetPair(member, score));
}else {
return redis.zadd(key, new ZsetPair(member, score));
}
} catch (Exception e) {
throw new JedisException(e);
}
}
代码示例来源:origin: Netflix/dyno-queues
@Override
public Long zadd(String key, double score, String member, ZAddParams params) {
try {
if(params.contains("xx")) {
Double existing = redis.zscore(key, member);
if(existing == null) {
return 0L;
}
redis.zadd(key, new ZsetPair(member, score));
return 1L;
}else {
return redis.zadd(key, new ZsetPair(member, score));
}
} catch (Exception e) {
throw new JedisException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!