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

import com.yahoo.vespa.documentmodel.SummaryField;
import com.yahoo.vespa.documentmodel.SummaryTransform;

import java.util.Set;

/**
 * @author Einar M R Rosenvinge
 */
public abstract class SummaryInFieldOperation implements FieldOperation {

    protected String name;
    protected SummaryTransform transform;
    protected Set<SummaryField.Source> sources = new java.util.LinkedHashSet<>();

    public SummaryInFieldOperation(String name) {
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setTransform(SummaryTransform transform) {
        this.transform = transform;
    }

    public SummaryTransform getTransform() {
        return transform;
    }

    public void addSource(String name) {
        sources.add(new SummaryField.Source(name));
    }

    public void addSource(SummaryField.Source source) {
        sources.add(source);
    }

}