aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/main/java/com/yahoo/document/DocumentRemove.java
blob: c1ba0d8594f979280a06552f50a44644c33eebaf (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document;

import java.util.Objects;

/**
 * @author baldersheim
 */
public class DocumentRemove extends DocumentOperation {

    private final DocumentId docId;

    public DocumentRemove(DocumentId docId) { this.docId = docId; }

    @Override
    public DocumentId getId() { return docId; }

    @Override
    public String toString() {
        return "DocumentRemove '" + docId + "'";
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if ( ! (o instanceof DocumentRemove)) return false;
        DocumentRemove that = (DocumentRemove) o;
        if ( ! docId.equals(that.docId)) return false;
        if ( ! Objects.equals(getCondition(), that.getCondition())) return false;
        return true;
    }

    @Override
    public int hashCode() {
        return docId.hashCode();
    }

}