blob: b73123b7f80980a3d8b42bbf7be5c264398dc629 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document;
/**
* Base class for "document operations".
* These include "put" (DocumentPut), "update" (DocumentUpdate), "remove" (DocumentRemove)
* and "get" (DocumentGet).
*
* @author Vegard Sjonfjell
*/
public abstract class DocumentOperation {
private TestAndSetCondition condition = TestAndSetCondition.NOT_PRESENT_CONDITION;
public abstract DocumentId getId();
public void setCondition(TestAndSetCondition condition) {
this.condition = condition;
}
public TestAndSetCondition getCondition() {
return condition;
}
protected DocumentOperation() {}
/**
* Copy constructor
* @param other DocumentOperation to copy
*/
protected DocumentOperation(DocumentOperation other) {
this.condition = other.condition;
}
}
|