// This assumes correct order in the enum. If that ever changes, we will have to scan for 'code' field.
BinaryCommand bcmd = BinaryCommand.values()[opcode];
Command cmdType = bcmd.correspondingCommand;
CommandMessage cmdMessage = CommandMessage.command(cmdType);
cmdMessage.noreply = bcmd.noreply;
cmdMessage.cas_key = cas;
cmdMessage.opaque = opaque;
cmdMessage.addKeyToResponse = bcmd.addKeyToResponse;