All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.schema.document.FieldSet Maven / Gradle / Ivy

// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.schema.document;

import java.util.LinkedHashSet;
import java.util.Set;
import java.util.TreeSet;

import static java.util.Comparator.comparing;

/**
 * Searchable collection of fields.
 * 
 * @author baldersheim
 */
public class FieldSet {
    
    private final String name;
    private final Set queryCommands = new LinkedHashSet<>();
    private final Set fieldNames = new TreeSet<>();
    private final Set fields = new TreeSet<>(comparing(ImmutableSDField::asField));
    private Matching matching = null;

    public FieldSet(String name) { this.name = name; }
    public String getName() { return name; }
    public FieldSet addFieldName(String field) { fieldNames.add(field); return this; }
    public Set getFieldNames() { return fieldNames; }
    public Set fields() { return fields; }
    public Set queryCommands() { return queryCommands; }

    public void setMatching(Matching matching) {
        this.matching = matching;
    }

    public Matching getMatching() {
        return matching;
    }

    @Override
    public String toString() { return "fieldset '" + name + "'"; }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy