Set<ValueSpecification> resolvedValues = Sets.newHashSet();
for (ComputedValue computedValue : results.getAllMarketData()) {
resolvedValues.add(computedValue.getSpecification());
final DependencyNode nodeProducing = graph.getNodeProducing(computedValue.getSpecification());
if ((nodeProducing != null) && isTerminalUnstructuredOutput(nodeProducing, graph)) {
ExternalIdBundle identifiers = resolveExternalIdBundle(resolver, computedValue.getSpecification());
if (identifiers != null) {
snapshot.putValue(identifiers, computedValue.getSpecification().getValueName(), new ValueSnapshot(computedValue.getValue()));
}
}
}
//missing values go over the wire as nulls
SetView<ValueSpecification> missingValues = Sets.difference(graph.getAllRequiredMarketData(), resolvedValues);
for (ValueSpecification missingValue : missingValues) {
ExternalIdBundle missingExternalIdBundle = resolveExternalIdBundle(resolver, missingValue);
snapshot.putValue(missingExternalIdBundle, missingValue.getValueName(), null);
}
}
return snapshot;
}