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

com.logicbus.redis.params.ScanParams Maven / Gradle / Ivy

There is a newer version: 1.6.17
Show newest version
package com.logicbus.redis.params;

import com.logicbus.redis.client.Params;
import com.logicbus.redis.util.SafeEncoder;

/**
 * Key扫描时用的参数
 * 
 * @author duanyy
 *
 */
public class ScanParams extends Params {
	protected final byte [] KW_MATCH = SafeEncoder.encode("MATCH");
	protected final byte [] KW_COUNT = SafeEncoder.encode("COUNT");
	
	public ScanParams match(final byte[] pattern) {
		add(KW_MATCH);
		add(pattern);
		return this;
	}

	public ScanParams match(final String pattern) {
		add(KW_MATCH);
		add(SafeEncoder.encode(pattern));
		return this;
	}

	public ScanParams count(final int count) {
		add(KW_COUNT);
		add(SafeEncoder.encode(count));
		return this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy