aboutsummaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-04-27 14:51:50 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2023-04-27 14:51:50 +0200
commit10c64dec098e1b5109eb07c0c43a879b8cc38c0b (patch)
tree738753a148c1160a2a37105e8e228afb5ed9e946 /document
parent8993b9df81bf0acbbe42db002a202f46f019e7e6 (diff)
Remove common ConditionalFeedOperation
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/vespaxmlparser/ConditionalFeedOperation.java24
-rw-r--r--document/src/main/java/com/yahoo/vespaxmlparser/DocumentFeedOperation.java10
-rw-r--r--document/src/main/java/com/yahoo/vespaxmlparser/DocumentUpdateFeedOperation.java9
-rw-r--r--document/src/main/java/com/yahoo/vespaxmlparser/RemoveFeedOperation.java9
4 files changed, 21 insertions, 31 deletions
diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/ConditionalFeedOperation.java b/document/src/main/java/com/yahoo/vespaxmlparser/ConditionalFeedOperation.java
deleted file mode 100644
index 2f63bad714c..00000000000
--- a/document/src/main/java/com/yahoo/vespaxmlparser/ConditionalFeedOperation.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespaxmlparser;
-
-import com.yahoo.document.TestAndSetCondition;
-
-public class ConditionalFeedOperation extends FeedOperation {
-
- private final TestAndSetCondition condition;
-
- protected ConditionalFeedOperation(Type type) {
- super(type);
- this.condition = TestAndSetCondition.NOT_PRESENT_CONDITION;
- }
- protected ConditionalFeedOperation(Type type, TestAndSetCondition condition) {
- super(type);
- this.condition = condition;
- }
-
- @Override
- public TestAndSetCondition getCondition() {
- return condition;
- }
-
-}
diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/DocumentFeedOperation.java b/document/src/main/java/com/yahoo/vespaxmlparser/DocumentFeedOperation.java
index 7a62bd92f37..f76cad08e50 100644
--- a/document/src/main/java/com/yahoo/vespaxmlparser/DocumentFeedOperation.java
+++ b/document/src/main/java/com/yahoo/vespaxmlparser/DocumentFeedOperation.java
@@ -2,13 +2,14 @@
package com.yahoo.vespaxmlparser;
import com.yahoo.document.DocumentPut;
+import com.yahoo.document.TestAndSetCondition;
-public class DocumentFeedOperation extends ConditionalFeedOperation {
+public class DocumentFeedOperation extends FeedOperation {
private final DocumentPut put;
public DocumentFeedOperation(DocumentPut put) {
- super(Type.DOCUMENT, put.getCondition());
+ super(Type.DOCUMENT);
this.put = put;
}
@@ -17,5 +18,10 @@ public class DocumentFeedOperation extends ConditionalFeedOperation {
return put;
}
+ @Override
+ public TestAndSetCondition getCondition() {
+ return put.getCondition();
+ }
+
}
diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/DocumentUpdateFeedOperation.java b/document/src/main/java/com/yahoo/vespaxmlparser/DocumentUpdateFeedOperation.java
index c8b57dbce45..cddf0557bcc 100644
--- a/document/src/main/java/com/yahoo/vespaxmlparser/DocumentUpdateFeedOperation.java
+++ b/document/src/main/java/com/yahoo/vespaxmlparser/DocumentUpdateFeedOperation.java
@@ -2,11 +2,12 @@
package com.yahoo.vespaxmlparser;
import com.yahoo.document.DocumentUpdate;
+import com.yahoo.document.TestAndSetCondition;
-public class DocumentUpdateFeedOperation extends ConditionalFeedOperation {
+public class DocumentUpdateFeedOperation extends FeedOperation {
private final DocumentUpdate update;
public DocumentUpdateFeedOperation(DocumentUpdate update) {
- super(Type.UPDATE, update.getCondition());
+ super(Type.UPDATE);
this.update = update;
}
@@ -14,4 +15,8 @@ public class DocumentUpdateFeedOperation extends ConditionalFeedOperation {
public DocumentUpdate getDocumentUpdate() {
return update;
}
+ @Override
+ public TestAndSetCondition getCondition() {
+ return update.getCondition();
+ }
}
diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/RemoveFeedOperation.java b/document/src/main/java/com/yahoo/vespaxmlparser/RemoveFeedOperation.java
index 6c9c87feef4..82455ea165a 100644
--- a/document/src/main/java/com/yahoo/vespaxmlparser/RemoveFeedOperation.java
+++ b/document/src/main/java/com/yahoo/vespaxmlparser/RemoveFeedOperation.java
@@ -1,14 +1,13 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespaxmlparser;
-import com.yahoo.document.DocumentId;
import com.yahoo.document.DocumentRemove;
import com.yahoo.document.TestAndSetCondition;
-public class RemoveFeedOperation extends ConditionalFeedOperation {
+public class RemoveFeedOperation extends FeedOperation {
private final DocumentRemove remove;
public RemoveFeedOperation(DocumentRemove remove) {
- super(Type.REMOVE, remove.getCondition());
+ super(Type.REMOVE);
this.remove = remove;
}
@@ -16,4 +15,8 @@ public class RemoveFeedOperation extends ConditionalFeedOperation {
public DocumentRemove getDocumentRemove() {
return remove;
}
+ @Override
+ public TestAndSetCondition getCondition() {
+ return remove.getCondition();
+ }
}