本文整理汇总了Java中redis.clients.jedis.Jedis.hexists方法的典型用法代码示例。如果您正苦于以下问题:Java Jedis.hexists方法的具体用法?Java Jedis.hexists怎么用?Java Jedis.hexists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类redis.clients.jedis.Jedis
的用法示例。
在下文中一共展示了Jedis.hexists方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hexists
import redis.clients.jedis.Jedis; //导入方法依赖的package包/类
public boolean hexists(String key, String field) {
Jedis jedis = null;
boolean success = true;
try {
jedis = jedisPool.getResource();
if (jedis == null) {
success = false;
return false;
}
return jedis.hexists(key, field);
} catch (Exception e) {
success = false;
returnBrokenResource(jedis, "hexists", e);
} finally {
releaseReidsSource(success, jedis);
}
return false;
}
示例2: mapExists
import redis.clients.jedis.Jedis; //导入方法依赖的package包/类
/**
* 判断Map缓存中的Key是否存在
*
* @param key 键
* @param mapKey 值
* @return
*/
public static boolean mapExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(key, mapKey);
logger.debug("mapExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例3: mapObjectExists
import redis.clients.jedis.Jedis; //导入方法依赖的package包/类
/**
* 判断Map缓存中的Key是否存在
*
* @param key 键
* @param mapKey 值
* @return
*/
public static boolean mapObjectExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(getBytesKey(key), getBytesKey(mapKey));
logger.debug("mapObjectExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapObjectExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例4: hexists
import redis.clients.jedis.Jedis; //导入方法依赖的package包/类
@Override
public Boolean hexists(String key, String field) {
Jedis jedis = jedisPool.getResource();
Boolean result = jedis.hexists(key, field);
jedis.close();
return result;
}
示例5: mapExists
import redis.clients.jedis.Jedis; //导入方法依赖的package包/类
/**
* 判断Map缓存中的Key是否存在
* @param key 键
* @return
*/
public static boolean mapExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(key, mapKey);
logger.debug("mapExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例6: mapObjectExists
import redis.clients.jedis.Jedis; //导入方法依赖的package包/类
/**
* 判断Map缓存中的Key是否存在
* @param key 键
* @return
*/
public static boolean mapObjectExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(getBytesKey(key), getBytesKey(mapKey));
logger.debug("mapObjectExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapObjectExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例7: hexists
import redis.clients.jedis.Jedis; //导入方法依赖的package包/类
@Override
public Boolean hexists(String key, String field) {
Jedis jedis = null;
Boolean res = false;
try {
jedis = pool.getResource();
res = jedis.hexists(key, field);
} catch (Exception e) {
LOGGER.error(e.getMessage());
} finally {
returnResource(pool, jedis);
}
return res;
}