本文整理汇总了Java中com.thimbleware.jmemcached.protocol.Op类的典型用法代码示例。如果您正苦于以下问题:Java Op类的具体用法?Java Op怎么用?Java Op使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Op类属于com.thimbleware.jmemcached.protocol包,在下文中一共展示了Op类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatusCode
import com.thimbleware.jmemcached.protocol.Op; //导入依赖的package包/类
public ResponseCode getStatusCode(ResponseMessage command) {
Op cmd = command.cmd.op;
if (cmd == Op.GET || cmd == Op.GETS) {
return ResponseCode.OK;
} else if (cmd == Op.SET || cmd == Op.CAS || cmd == Op.ADD || cmd == Op.REPLACE || cmd == Op.APPEND || cmd == Op.PREPEND) {
switch (command.response) {
case EXISTS:
return ResponseCode.KEYEXISTS;
case NOT_FOUND:
return ResponseCode.KEYNF;
case NOT_STORED:
return ResponseCode.NOT_STORED;
case STORED:
return ResponseCode.OK;
}
} else if (cmd == Op.INCR || cmd == Op.DECR) {
return command.incrDecrResponse == null ? ResponseCode.KEYNF : ResponseCode.OK;
} else if (cmd == Op.DELETE) {
switch (command.deleteResponse) {
case DELETED:
return ResponseCode.OK;
case NOT_FOUND:
return ResponseCode.KEYNF;
}
} else if (cmd == Op.STATS) {
return ResponseCode.OK;
} else if (cmd == Op.VERSION) {
return ResponseCode.OK;
} else if (cmd == Op.FLUSH_ALL) {
return ResponseCode.OK;
}
return ResponseCode.UNKNOWN;
}
示例2: BinaryOp
import com.thimbleware.jmemcached.protocol.Op; //导入依赖的package包/类
BinaryOp(int code, Op correspondingOp, boolean noreply) {
this.code = (byte)code;
this.correspondingOp = correspondingOp;
this.noreply = noreply;
}