private void writeOrdinatedValueSnapshot(Map<String, String> prefixes,
Map<Pair<Object, Object>, ValueSnapshot> valueSnapshots) {
for (Map.Entry<Pair<Object, Object>, ValueSnapshot> entry : valueSnapshots.entrySet()) {
Map<String, String> tempRow = new HashMap<>();
ValueSnapshot valueSnapshot = entry.getValue();
tempRow.putAll(prefixes);
String surfaceX;
if (entry.getKey().getFirst() instanceof Tenor) {
surfaceX = ((Tenor) entry.getKey().getFirst()).toFormattedString();
} else {
surfaceX = entry.getKey().getFirst().toString();
}
String surfaceY;
if (entry.getKey().getSecond() instanceof Pair) {
surfaceY = ((Pair) entry.getKey().getSecond()).getFirst() + "|" + ((Pair) entry.getKey().getSecond()).getSecond();
} else {
surfaceY = entry.getKey().getSecond().toString();
}
tempRow.put(SnapshotColumns.SURFACE_X.get(), surfaceX);
tempRow.put(SnapshotColumns.SURFACE_Y.get(), surfaceY);
if (valueSnapshot.getMarketValue() != null) {
tempRow.put(SnapshotColumns.MARKET_VALUE.get(), valueSnapshot.getMarketValue().toString());
}
if (valueSnapshot.getOverrideValue() != null) {
tempRow.put(SnapshotColumns.OVERRIDE_VALUE.get(), valueSnapshot.getOverrideValue().toString());
}
_sheetWriter.writeNextRow(tempRow);
}
}