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

cn.cheny.toolbox.redis.client.spring.AbstractMapRedisClient Maven / Gradle / Ivy

There is a newer version: 2.3.6-jdk8
Show newest version
package cn.cheny.toolbox.redis.client.spring;

import cn.cheny.toolbox.redis.client.MapRedisApi;

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

/**
 * @author cheney
 */
public abstract class AbstractMapRedisClient extends AbstractRedisClient implements MapRedisApi {

    @Override
    public void hSetMap(String k, Map kv, int days) {
        hSetMap(k, kv);
        expire(k, days);
    }

    @Override
    public void hSetMap(String k, Map kv) {
        getHashOperationForMap().putAll(k, kv);
    }

    @Override
    public void hSet(String k, String hk, V v) {
        getHashOperationForMap().put(k, hk, v);
    }

    @Override
    public V hGet(String k, String hk) {
        return getHashOperationForMap().get(k, hk);
    }

    @Override
    public Map hGetMap(String k) {
        return getHashOperationForMap().entries(k);
    }

    @Override
    public long hLen(String key) {
        return getHashOperationForMap().size(key);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy