simplify getOpType by using Enum's static function valueOf

simplify getOpType in WriteType and ReadType by using Enum's static function valueOf
Can you remove this function? Not needed