| 860 | } |
| 861 | |
| 862 | bool Field::Equals(const Field& other, bool check_metadata) const { |
| 863 | if (this == &other) { |
| 864 | return true; |
| 865 | } |
| 866 | if (this->name_ == other.name_ && this->nullable_ == other.nullable_ && |
| 867 | this->type_->Equals(*other.type_.get(), check_metadata)) { |
| 868 | if (!check_metadata) { |
| 869 | return true; |
| 870 | } else if (this->HasMetadata() && other.HasMetadata()) { |
| 871 | return metadata_->Equals(*other.metadata_); |
| 872 | } else if (!this->HasMetadata() && !other.HasMetadata()) { |
| 873 | return true; |
| 874 | } else { |
| 875 | return false; |
| 876 | } |
| 877 | } |
| 878 | return false; |
| 879 | } |
| 880 | |
| 881 | bool Field::Equals(const std::shared_ptr<Field>& other, bool check_metadata) const { |
| 882 | return Equals(*other.get(), check_metadata); |