package com.younike.common.redis;

//import javax.xml.rpc.ServiceException;

import org.redisson.api.RMap;

public interface ICached {

	public String getString(String key) ;
	public boolean set(String key, String value, int expiry);
	public boolean set(String key, String value);

	public boolean put(String keyMap, String key, Object value);
	public <T> T get(String key) ;
	public boolean delete(String key);
	public boolean exists(String key);
	public boolean flushAll();
	Object pop(String mapKey, Object key);

	/**
	 * 2021-8-24 Another 根据 mapKey 获取 所有信息
	 * @param mapKey
	 * @return
	 */
	RMap<Object, Object> pop(String mapKey);

	/**
	 * 2021-9-1 Another 设值（有效时间，单位：分钟）
	 * @param keyMap
	 * @param key
	 * @param value
	 * @param effectiveTime 有效分钟
	 * @return
	 */
	boolean put(String keyMap, String key, Object value, int effectiveTime);

	/**
	 *
	 *
	 * @param keyMap        键映射表
	 * @param key           关键
	 * @param value         价值
	 * @param effectiveTime 有效时间 (秒)
	 * @return boolean
	 */
	boolean putBySecond(String keyMap, String key, Object value, int effectiveTime);

}
