redis.clients.jedis.params.RestoreParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis_preview Show documentation
Show all versions of jedis_preview Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis.params;
import redis.clients.jedis.CommandArguments;
import redis.clients.jedis.Protocol.Keyword;
public class RestoreParams implements IParams {
private boolean replace;
private boolean absTtl;
private Long idleTime;
private Long frequency;
public static RestoreParams restoreParams() {
return new RestoreParams();
}
public RestoreParams replace() {
this.replace = true;
return this;
}
public RestoreParams absTtl() {
this.absTtl = true;
return this;
}
public RestoreParams idleTime(long idleTime) {
this.idleTime = idleTime;
return this;
}
public RestoreParams frequency(long frequency) {
this.frequency = frequency;
return this;
}
@Override
public void addParams(CommandArguments args) {
if (replace) {
args.add(Keyword.REPLACE);
}
if (absTtl) {
args.add(Keyword.ABSTTL);
}
if (idleTime != null) {
args.add(Keyword.IDLETIME).add(idleTime);
}
if (frequency != null) {
args.add(Keyword.FREQ).add(frequency);
}
}
}