15 #include "google/cloud/spanner/keys.h"
16 #include "google/cloud/spanner/value.h"
17 #include <google/protobuf/util/message_differencer.h>
18 #include <google/spanner/v1/keys.pb.h>
26 void AppendKey(
google::protobuf::ListValue& lv, Key&& key) {
28 *lv.add_values() = spanner_internal::ToProto(std::move(v)).second;
34 return a.key_ == b.key_ && a.bound_ == b.bound_;
38 if (proto_.all())
return *
this;
39 AppendKey(*proto_.add_keys(), std::move(key));
44 if (proto_.all())
return *
this;
45 auto* range = proto_.add_ranges();
47 ? range->mutable_start_closed()
48 : range->mutable_start_open();
49 AppendKey(*start_proto, std::move(start)
.key());
51 ? range->mutable_end_closed()
52 : range->mutable_end_open();
53 AppendKey(*end_proto, std::move(end)
.key());
58 google::protobuf::util::MessageDifferencer differencer;
59 return differencer.Compare(a.proto_, b.proto_);