diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-04-25 19:57:57 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-04-25 19:57:57 +0200 |
commit | 907158959c159904c3f4d20274c565806746ac15 (patch) | |
tree | f4db3e3d2fc81cf061cb1811b5bc3af4ca91695f /document/src/main/java/com/yahoo/vespaxmlparser/FeedOperation.java | |
parent | 249fe76c9437d0f1a033294df98d8d8101baef2c (diff) |
Refactor to allow for lazy decode.
Diffstat (limited to 'document/src/main/java/com/yahoo/vespaxmlparser/FeedOperation.java')
-rw-r--r-- | document/src/main/java/com/yahoo/vespaxmlparser/FeedOperation.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/FeedOperation.java b/document/src/main/java/com/yahoo/vespaxmlparser/FeedOperation.java new file mode 100644 index 00000000000..58371faeced --- /dev/null +++ b/document/src/main/java/com/yahoo/vespaxmlparser/FeedOperation.java @@ -0,0 +1,40 @@ +package com.yahoo.vespaxmlparser; + +import com.yahoo.document.Document; +import com.yahoo.document.DocumentId; +import com.yahoo.document.DocumentUpdate; +import com.yahoo.document.TestAndSetCondition; + +public abstract class FeedOperation { + public enum Type {DOCUMENT, REMOVE, UPDATE, INVALID} + + private Type type; + protected FeedOperation() { + this(Type.INVALID); + } + protected FeedOperation(Type type) { + this.type = type; + } + public final Type getType() { return type; } + protected final void setType(Type type) { + this.type = type; + } + + public abstract Document getDocument(); + public abstract DocumentUpdate getDocumentUpdate(); + public abstract DocumentId getRemove(); + + public TestAndSetCondition getCondition() { + return TestAndSetCondition.NOT_PRESENT_CONDITION; + } + @Override + public String toString() { + return "Operation{" + + "type=" + getType() + + ", doc=" + getDocument() + + ", remove=" + getRemove() + + ", docUpdate=" + getDocumentUpdate() + + " testandset=" + getCondition() + + '}'; + } +}
\ No newline at end of file |