| 534 | } |
| 535 | |
| 536 | absl::Status MapEnumFieldToValue( |
| 537 | const google::protobuf::MapValueConstRef& value, |
| 538 | const google::protobuf::FieldDescriptor* absl_nonnull field, |
| 539 | google::protobuf::MessageLite* absl_nonnull result) { |
| 540 | ABSL_DCHECK_EQ(value.type(), field->cpp_type()); |
| 541 | ABSL_DCHECK(!field->is_repeated()); |
| 542 | ABSL_DCHECK_EQ(field->cpp_type(), FieldDescriptor::CPPTYPE_ENUM); |
| 543 | ABSL_DCHECK_NE(field->enum_type()->full_name(), |
| 544 | "google.protobuf.NullValue"); |
| 545 | if (const auto* value_descriptor = |
| 546 | field->enum_type()->FindValueByNumber(value.GetEnumValue()); |
| 547 | value_descriptor != nullptr) { |
| 548 | SetStringValue(result, value_descriptor->name()); |
| 549 | } else { |
| 550 | SetNumberValue(result, value.GetEnumValue()); |
| 551 | } |
| 552 | return absl::OkStatus(); |
| 553 | } |
| 554 | |
| 555 | absl::Status MapNullFieldToValue( |
| 556 | const google::protobuf::MapValueConstRef& value, |
nothing calls this directly
no test coverage detected