By passing a typed value we can conserve the type information to later use that to convert it back into the correct protobuf type. The type conversion is now done inside setPref.