forked from fanruan/demo-tabledata-redis
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
476 B
27 lines
476 B
7 years ago
|
package com.fr.plugin.db.redis.core;
|
||
|
|
||
|
public enum RedisMechanism {
|
||
|
|
||
|
NONE(0), SHA1(1),CR(2);
|
||
|
|
||
|
|
||
|
private int type;
|
||
|
RedisMechanism(int type) {
|
||
|
this.type = type;
|
||
|
}
|
||
|
|
||
|
public int toInt() {
|
||
|
return type;
|
||
|
|
||
|
}
|
||
|
|
||
|
public static RedisMechanism parse(int type) {
|
||
|
for (RedisMechanism m : RedisMechanism.values()) {
|
||
|
if (m.type == type) {
|
||
|
return m;
|
||
|
}
|
||
|
}
|
||
|
return RedisMechanism.NONE;
|
||
|
}
|
||
|
}
|