diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2021-02-05 17:47:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-05 17:47:24 +0100 |
commit | f8d7872d2be31751cda03ea40c687da042fc96bc (patch) | |
tree | 870b8b168c0bcb2aa4014897f07e937a057981be /document | |
parent | b26869dc549c1c86b660fe18156089f1a2e9a39d (diff) | |
parent | 79709d8f64ef2a076c9e8dcbcd4dcf5f9eafabbf (diff) |
Merge pull request #16402 from vespa-engine/jonmv/expand-document-v1-visit-API
Jonmv/expand document v1 visit api
Diffstat (limited to 'document')
3 files changed, 11 insertions, 6 deletions
diff --git a/document/src/main/java/com/yahoo/document/DocumentPut.java b/document/src/main/java/com/yahoo/document/DocumentPut.java index e24388cd65f..25246dc9a9e 100644 --- a/document/src/main/java/com/yahoo/document/DocumentPut.java +++ b/document/src/main/java/com/yahoo/document/DocumentPut.java @@ -54,7 +54,7 @@ public class DocumentPut extends DocumentOperation { if (o == null || getClass() != o.getClass()) return false; DocumentPut that = (DocumentPut) o; return document.equals(that.document) && - getCondition().equals(that.getCondition()); + Objects.equals(getCondition(), that.getCondition()); } @Override diff --git a/document/src/main/java/com/yahoo/document/DocumentRemove.java b/document/src/main/java/com/yahoo/document/DocumentRemove.java index 79f80713c44..a815d9c0a5a 100644 --- a/document/src/main/java/com/yahoo/document/DocumentRemove.java +++ b/document/src/main/java/com/yahoo/document/DocumentRemove.java @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document; +import java.util.Objects; + /** * @author baldersheim */ @@ -21,9 +23,10 @@ public class DocumentRemove extends DocumentOperation { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof DocumentRemove)) return false; + if ( ! (o instanceof DocumentRemove)) return false; DocumentRemove that = (DocumentRemove) o; - if (!docId.equals(that.docId)) return false; + if ( ! docId.equals(that.docId)) return false; + if ( ! Objects.equals(getCondition(), that.getCondition())) return false; return true; } diff --git a/document/src/main/java/com/yahoo/document/DocumentUpdate.java b/document/src/main/java/com/yahoo/document/DocumentUpdate.java index 5c748f48f15..cba51ee999e 100644 --- a/document/src/main/java/com/yahoo/document/DocumentUpdate.java +++ b/document/src/main/java/com/yahoo/document/DocumentUpdate.java @@ -19,6 +19,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; /** @@ -362,9 +363,10 @@ public class DocumentUpdate extends DocumentOperation implements Iterable<FieldP if (docId != null ? !docId.equals(that.docId) : that.docId != null) return false; if (documentType != null ? !documentType.equals(that.documentType) : that.documentType != null) return false; - if (!fieldPathUpdates.equals(that.fieldPathUpdates)) return false; - if (!id2FieldUpdates.equals(that.id2FieldUpdates)) return false; - if (this.getCreateIfNonExistent() != ((DocumentUpdate) o).getCreateIfNonExistent()) return false; + if ( ! fieldPathUpdates.equals(that.fieldPathUpdates)) return false; + if ( ! id2FieldUpdates.equals(that.id2FieldUpdates)) return false; + if (this.getCreateIfNonExistent() != that.getCreateIfNonExistent()) return false; + if ( ! Objects.equals(getCondition(), that.getCondition())) return false; return true; } |