blob: e5ddc2c67a3a5bfae3ea90b9e80c49cf7e2aa879 (
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
|
// 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 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;
}
}
|