blob: c5ce2e7e181c9e46b7fa04502b1e02bf2af9d034 (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document;
/**
* @author Vegard Sjonfjell
*/
public class DocumentPut extends DocumentOperation {
private final Document document;
public DocumentPut(Document document) {
this.document = document;
}
public DocumentPut(DocumentType docType, DocumentId docId) {
this.document = new Document(docType, docId);
}
public DocumentPut(DocumentType docType, String docId) {
this.document = new Document(docType, docId);
}
public Document getDocument() {
return document;
}
public DocumentId getId() {
return document.getId();
}
/**
* Copy constructor
*
* @param other the DocumentPut to copy
*/
public DocumentPut(DocumentPut other) {
super(other);
this.document = new Document(other.getDocument());
}
/**
* Base this DocumentPut on another, but use newDocument as the Document.
*/
public DocumentPut(DocumentPut other, Document newDocument) {
super(other);
this.document = newDocument;
}
@Override
public String toString() {
return "put of document " + getId();
}
}
|