本文整理汇总了Java中redis.clients.util.SafeEncoder.encode方法的典型用法代码示例。如果您正苦于以下问题:Java SafeEncoder.encode方法的具体用法?Java SafeEncoder.encode怎么用?Java SafeEncoder.encode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类redis.clients.util.SafeEncoder
的用法示例。
在下文中一共展示了SafeEncoder.encode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evalResult
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
private Object evalResult(Object result) {
if (result instanceof byte[])
return SafeEncoder.encode((byte[]) result);
if (result instanceof List<?>) {
List<?> list = (List<?>) result;
List<Object> listResult = new ArrayList<Object>(list.size());
for (Object bin : list) {
listResult.add(evalResult(bin));
}
return listResult;
}
return result;
}
示例2: getElement
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public String getElement() {
if (null != element) {
return SafeEncoder.encode(element);
} else {
return null;
}
}
示例3: scriptExists
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public void scriptExists(String... sha1) {
final byte[][] bsha1 = new byte[sha1.length][];
for (int i = 0; i < bsha1.length; i++) {
bsha1[i] = SafeEncoder.encode(sha1[i]);
}
scriptExists(bsha1);
}
示例4: subscribe
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public void subscribe(final String... channels) {
final byte[][] cs = new byte[channels.length][];
for (int i = 0; i < cs.length; i++) {
cs[i] = SafeEncoder.encode(channels[i]);
}
subscribe(cs);
}
示例5: watch
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public void watch(final String... keys) {
final byte[][] bargs = new byte[keys.length][];
for (int i = 0; i < bargs.length; i++) {
bargs[i] = SafeEncoder.encode(keys[i]);
}
watch(bargs);
}
示例6: pubsub
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public void pubsub(final String subcommand, final String... args) {
final byte[][] arg = new byte[args.length + 1][];
for (int i = 1; i < arg.length; i++) {
arg[i] = SafeEncoder.encode(args[i - 1]);
}
arg[0] = SafeEncoder.encode(subcommand);
pubsub(arg);
}
示例7: sunionstore
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
@Override
public void sunionstore(final String dstkey, final String... keys) {
final byte[][] bkeys = new byte[keys.length][];
for (int i = 0; i < bkeys.length; i++) {
bkeys[i] = SafeEncoder.encode(keys[i]);
}
sunionstore(SafeEncoder.encode(dstkey), bkeys);
}
示例8: bitfield
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
@Override
public void bitfield(final String key, final String... arguments) {
byte[][] argumentArray = new byte[arguments.length][];
int index = 0;
for (String argument : arguments) {
argumentArray[index++] = SafeEncoder.encode(argument);
}
bitfield(SafeEncoder.encode(key), argumentArray);
}
示例9: punsubscribe
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public void punsubscribe(final String... patterns) {
final byte[][] ps = new byte[patterns.length][];
for (int i = 0; i < ps.length; i++) {
ps[i] = SafeEncoder.encode(patterns[i]);
}
punsubscribe(ps);
}
示例10: Tuple
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public Tuple(String element, Double score) {
super();
this.element = SafeEncoder.encode(element);
this.score = score;
}
示例11: generateHostAndPort
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
private HostAndPort generateHostAndPort(List<Object> hostInfos) {
return new HostAndPort(SafeEncoder.encode((byte[]) hostInfos.get(0)), ((Long) hostInfos.get(1)).intValue());
}
示例12: LIST_POSITION
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
private LIST_POSITION() {
raw = SafeEncoder.encode(name());
}
示例13: toByteArray
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public static final byte[] toByteArray(final double value) {
return SafeEncoder.encode(String.valueOf(value));
}
示例14: toByteArray
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
public static final byte[] toByteArray(final long value) {
return SafeEncoder.encode(String.valueOf(value));
}
示例15: getStringCursor
import redis.clients.util.SafeEncoder; //导入方法依赖的package包/类
/**
* FIXME: This method should be changed to getCursor() on next major release
*/
public String getStringCursor() {
return SafeEncoder.encode(cursor);
}