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

com.open.capacity.redis.prefix.BasePrefix Maven / Gradle / Ivy

package com.open.capacity.redis.prefix;

/**
 * redis key封装
 */
public abstract class BasePrefix implements KeyPrefix{
	
	private int expireSeconds;
	
	private String prefix;
	
	public BasePrefix(String prefix) {//0代表永不过期
		this(0, prefix);
	}
	
	public BasePrefix( int expireSeconds, String prefix) {
		this.expireSeconds = expireSeconds;
		this.prefix = prefix;
	}
	
	public int expireSeconds() {//默认0代表永不过期
		return expireSeconds;
	}

	public String getPrefix() {
		String className = getClass().getSimpleName();
		return className+":" + prefix;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy