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

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

package com.mizhousoft.redis.command;

import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * ObjectCommand
 *
 * @version
 */
public interface ObjectCommand
{
	/**
	 * 写缓存(永久有效)
	 * 
	 * @param key
	 * @param value
	 */
	 boolean set(final String key, T value);

	/**
	 * 写缓存(有时间限制,单位默认秒)
	 * 
	 * @param key
	 * @param value
	 * @param expireTime
	 */
	 boolean setex(final String key, T value, long expireTime);

	/**
	 * 写缓存(有时间限制,可指定时间单位)
	 * 
	 * @param key
	 * @param value
	 * @param expireTime
	 * @param timeUnit
	 */
	 boolean setex(final String key, T value, long expireTime, TimeUnit timeUnit);

	/**
	 * 设置多个值
	 * 
	 * @param values
	 */
	 boolean mset(Map values);

	/**
	 * 读缓存
	 * 
	 * @param 
	 * @param key
	 * @param clazz
	 * @return
	 */
	 T get(final String key, Class clazz);

	/**
	 * 读取多个
	 * 
	 * @param 
	 * @param clazz
	 * @param keys
	 * @return
	 */
	 Map mget(Class clazz, String... keys);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy