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

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

import java.util.Set;

/**
 * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
 */
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);
    }
}