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

com.skynet.infrastructure.CacheService Maven / Gradle / Ivy

package com.skynet.infrastructure;

import java.util.List;

public interface CacheService {
	public Object get(String key, Class clazz) ;
	public void put(String key, Object value, int ttlInSeconds) ;
	public List mget(List keys, Class clazz) ;
	public void remove(String key) ;

	default void lpush(String key, Object value , int ttlInSeconds){};
	default void rpush(String key, Object value , int ttlInSeconds){};
	default void ltrime(String key, int start, int end){};
	default  List lget(String key, Class clazz){return  null;};
	default  T lpop(String key, Class clazz) {return null;}
	default String getAsString(String key){
		return (String) get(key, String.class);
	}

	default void putString(String key, String value){
		put(key, value, -1);
	}
}