|
|
|
@ -25,13 +25,12 @@ bool AnyMetadata::PackFrom(Arena* arena, const Message& message) { |
|
|
|
|
|
|
|
|
|
bool AnyMetadata::PackFrom(Arena* arena, const Message& message, |
|
|
|
|
absl::string_view type_url_prefix) { |
|
|
|
|
type_url_->Set( |
|
|
|
|
GetTypeUrl(message.GetDescriptor()->full_name(), type_url_prefix), arena); |
|
|
|
|
type_url_->Set(GetTypeUrl(message.GetTypeName(), type_url_prefix), arena); |
|
|
|
|
return message.SerializeToString(value_->Mutable(arena)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool AnyMetadata::UnpackTo(Message* message) const { |
|
|
|
|
if (!InternalIs(message->GetDescriptor()->full_name())) { |
|
|
|
|
if (!InternalIs(message->GetTypeName())) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return message->ParseFromString(value_->Get()); |
|
|
|
|