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

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * A set of fields that are imported from referenced document types.
 *
 * This is temporary AST structure that only refers to the imported fields by name.
 *
 * @author geirst
 */
public class TemporaryImportedFields {

    private final Map<String, TemporaryImportedField> fields = new LinkedHashMap<>();

    public void add(TemporaryImportedField importedField) {
        fields.put(importedField.fieldName(), importedField);
    }

    public Map<String, TemporaryImportedField> fields() {
        return Collections.unmodifiableMap(fields);
    }
}