redis.clients.jedis.params.sortedset.ZAddParams.contains()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(127)

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

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);
  }
}

相关文章