com.yahoo.schema.DocumentReferences 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;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.stream.Stream;
/**
* Contains all document references for a document mapped by field name
*
* @author bjorncs
*/
public class DocumentReferences implements Iterable> {
private final Map references;
public DocumentReferences(Map references) {
this.references = references;
}
public void mergeFrom(DocumentReferences other) {
references.putAll(other.references);
}
@Override
public Iterator> iterator() {
return Collections.unmodifiableSet(references.entrySet()).iterator();
}
public Map referenceMap() {
return Collections.unmodifiableMap(references);
}
public Stream> stream() {
return references.entrySet().stream();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy