make the fromString method public
remove duplicate null checks
created a MeasurementType object and add support for deserializing it from json