simplify getOpType by using Enum's static function valueOf
refactor according to comments
remove getOpType
Merge pull request #478 from shimingfei/simplifyGetOpType

simplify getOpType by using Enum's static function valueOf