simplify getOpType by using Enum's static function valueOf

simplify getOpType in WriteType and ReadType by using Enum's static function valueOf
Same as above.