/** * Obtains an identifier used to find legal entity information. * * @param legalEntityId the name * @return the identifier */ public static LegalEntityInformationId of(StandardId legalEntityId) { return new LegalEntityInformationId(legalEntityId); }
private double computeIndexFactor(CdsIndexIsdaCreditCurveNode node, MarketData marketData) { double numDefaulted = node.getLegalEntityIds().stream() .map(s -> marketData.getValue(LegalEntityInformationId.of(s))) .map(casting(LegalEntityInformation.class)) .filter(LegalEntityInformation::isDefaulted) .collect(Collectors.toList()) .size(); double numTotal = node.getLegalEntityIds().size(); return (numTotal - numDefaulted) / numTotal; }
/** * Obtains an identifier used to find legal entity information. * * @param legalEntityId the name * @return an identifier */ public static LegalEntityInformationId of(String legalEntityId) { return new LegalEntityInformationId(StandardId.parse(legalEntityId)); }