public static LocalDate getDateWithException(Map<String, String> fieldValueMap, String fieldName) {
return LocalDate.parse(getWithException(fieldValueMap, fieldName), CSV_DATE_FORMATTER);
}
public static void persistLiborRawSecurities(Set<Currency> currencies, ToolContext toolContext) {
SecurityMaster securityMaster = toolContext.getSecurityMaster();
byte[] rawData = new byte[] {0};
StringBuilder sb = new StringBuilder();
sb.append("Created ").append(currencies.size()).append(" libor securities:\n");
for (Currency ccy : currencies) {
ConventionBundle swapConvention = getSwapConventionBundle(ccy, toolContext.getConventionBundleSource());
ConventionBundle liborConvention = getLiborConventionBundle(swapConvention, toolContext.getConventionBundleSource());
sb.append("\t").append(liborConvention.getIdentifiers()).append("\n");
RawSecurity rawSecurity = new RawSecurity(LIBOR_RATE_SECURITY_TYPE, rawData);
rawSecurity.setExternalIdBundle(liborConvention.getIdentifiers());
SecurityDocument secDoc = new SecurityDocument();
secDoc.setSecurity(rawSecurity);
securityMaster.add(secDoc);
}
s_logger.info(sb.toString());
}