#include <softbus_daemon/registry/MetadataRegistry.h>

namespace softbus::daemon {

void MetadataRegistry::registerMetadata(const softbus::core::MetadataDef& metadata)
{
    entries_[metadata.objectRef] = metadata;
}

std::optional<softbus::core::MetadataDef> MetadataRegistry::findByObjectRef(const std::string& objectRef) const
{
    const auto it = entries_.find(objectRef);
    if (it == entries_.end()) {
        return std::nullopt;
    }
    return it->second;
}

} // namespace softbus::daemon
