All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mizhousoft.redis.command.HashCommand Maven / Gradle / Ivy

The newest version!
package com.mizhousoft.redis.command;

import java.util.List;
import java.util.Map;

/**
 * Hash Command
 *
 * @version
 */
public interface HashCommand extends HashLongCommand
{
	/**
	 * 删除Hash中的key
	 * 
	 * @param key
	 * @param fields
	 * @return
	 * @see Redis Documentation: HDEL
	 */
	long hdel(String key, String... fields);

	/**
	 * Hash中的key是否存在
	 * 
	 * @param key
	 * @param field
	 * @return
	 * @see Redis Documentation: HEXISTS
	 */
	boolean hexits(String key, String field);

	/**
	 * 根据Hash中的key获取集合
	 * 
	 * @param key
	 * @return
	 * @see Redis Documentation: HGETALL
	 */
	Map hgetall(String key);

	/**
	 * 获取Hash中的value
	 * 
	 * @param key
	 * @param field
	 * @return
	 * @see Redis Documentation: HGET
	 */
	String hget(String key, String field);

	/**
	 * 获取Hash中的多个数据
	 * 
	 * @param key
	 * @param fields
	 * @return
	 * @see Redis Documentation: HMGET
	 */
	Map hmget(String key, String... fields);

	/**
	 * 获取Hash中的key
	 * 
	 * @param key
	 * @return
	 * @see Redis Documentation: HKEYS?
	 */
	List hkeys(String key);

	/**
	 * 增加数据
	 * 
	 * @param key
	 * @param map
	 * @see Redis Documentation: HMSET
	 */
	void hmset(String key, Map map);

	/**
	 * 增加数据
	 * 
	 * @param key
	 * @param field
	 * @param value
	 * @see Redis Documentation: HSET
	 */
	void hset(String key, String field, String value);

	/**
	 * 递增
	 * 
	 * @param key
	 * @param field
	 * @param delta
	 * @return
	 * @see Redis Documentation: HINCRBY
	 */
	long hincrby(String key, String field, long delta);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy