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

import com.yahoo.document.DataType;
import com.yahoo.document.datatypes.FieldValue;
import com.yahoo.document.serialization.DocumentUpdateWriter;

/**
 * <p>Value update that represents clearing a field. Clearing a field mean removing it.</p>
 * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
 */
public class ClearValueUpdate extends ValueUpdate {

    public ClearValueUpdate() {
        super(ValueUpdateClassID.CLEAR);
    }

    @Override
    public FieldValue applyTo(FieldValue fval) {
        return null;
    }

    @Override
    protected void checkCompatibility(DataType fieldType) {
        // empty
    }

    @Override
    public FieldValue getValue() {
        return null;
    }

    @Override
    public void setValue(FieldValue value) {
        // empty
    }

    @Override
    public void serialize(DocumentUpdateWriter data, DataType superType) {
        data.write(this, superType);
    }
}