/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(ImmutableLegalEntityDiscountingProvider beanToCopy) { this.valuationDate = beanToCopy.getValuationDate(); this.repoCurveSecurityGroups = beanToCopy.getRepoCurveSecurityGroups(); this.repoCurveGroups = beanToCopy.getRepoCurveGroups(); this.repoCurves = beanToCopy.getRepoCurves(); this.issuerCurveGroups = beanToCopy.getIssuerCurveGroups(); this.issuerCurves = beanToCopy.getIssuerCurves(); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 113107279: // valuationDate return ((ImmutableLegalEntityDiscountingProvider) bean).getValuationDate(); case -1749299407: // repoCurveSecurityGroups return ((ImmutableLegalEntityDiscountingProvider) bean).getRepoCurveSecurityGroups(); case -1279842095: // repoCurveGroups return ((ImmutableLegalEntityDiscountingProvider) bean).getRepoCurveGroups(); case 587630454: // repoCurves return ((ImmutableLegalEntityDiscountingProvider) bean).getRepoCurves(); case 1830129450: // issuerCurveGroups return ((ImmutableLegalEntityDiscountingProvider) bean).getIssuerCurveGroups(); case -1909076611: // issuerCurves return ((ImmutableLegalEntityDiscountingProvider) bean).getIssuerCurves(); } return super.propertyGet(bean, propertyName, quiet); }
public void test_builder_noRepoRate() { ImmutableLegalEntityDiscountingProvider test = ImmutableLegalEntityDiscountingProvider.builder() .issuerCurveGroups(ImmutableMap.of(ID_ISSUER, GROUP_ISSUER)) .issuerCurves(ImmutableMap.of(Pair.of(GROUP_ISSUER, GBP), DSC_FACTORS_ISSUER)) .build(); assertEquals( test.issuerCurveDiscountFactors(ID_ISSUER, GBP), IssuerCurveDiscountFactors.of(DSC_FACTORS_ISSUER, GROUP_ISSUER)); assertEquals(test.getValuationDate(), DATE); }
public void test_builder_noValuationDate() { ImmutableLegalEntityDiscountingProvider test = ImmutableLegalEntityDiscountingProvider.builder() .issuerCurves(ImmutableMap.of(Pair.of(GROUP_ISSUER, GBP), DSC_FACTORS_ISSUER)) .issuerCurveGroups(ImmutableMap.of(ID_ISSUER, GROUP_ISSUER)) .repoCurves(ImmutableMap.of(Pair.of(GROUP_REPO_ISSUER, GBP), DSC_FACTORS_REPO)) .repoCurveGroups(ImmutableMap.of(ID_ISSUER, GROUP_REPO_ISSUER)) .build(); assertEquals( test.issuerCurveDiscountFactors(ID_ISSUER, GBP), IssuerCurveDiscountFactors.of(DSC_FACTORS_ISSUER, GROUP_ISSUER)); assertEquals(test.repoCurveDiscountFactors(ID_SECURITY, ID_ISSUER, GBP), RepoCurveDiscountFactors.of(DSC_FACTORS_REPO, GROUP_REPO_ISSUER)); assertEquals(test.repoCurveDiscountFactors(ID_ISSUER, GBP), RepoCurveDiscountFactors.of(DSC_FACTORS_REPO, GROUP_REPO_ISSUER)); assertEquals(test.getValuationDate(), DATE); }
public void test_builder() { ImmutableLegalEntityDiscountingProvider test = ImmutableLegalEntityDiscountingProvider.builder() .issuerCurves(ImmutableMap.of(Pair.of(GROUP_ISSUER, GBP), DSC_FACTORS_ISSUER)) .issuerCurveGroups(ImmutableMap.of(ID_ISSUER, GROUP_ISSUER)) .repoCurves(ImmutableMap.of(Pair.of(GROUP_REPO_SECURITY, GBP), DSC_FACTORS_REPO)) .repoCurveSecurityGroups(ImmutableMap.of(ID_SECURITY, GROUP_REPO_SECURITY)) .valuationDate(DATE) .build(); assertEquals( test.issuerCurveDiscountFactors(ID_ISSUER, GBP), IssuerCurveDiscountFactors.of(DSC_FACTORS_ISSUER, GROUP_ISSUER)); assertEquals(test.repoCurveDiscountFactors(ID_SECURITY, ID_ISSUER, GBP), RepoCurveDiscountFactors.of(DSC_FACTORS_REPO, GROUP_REPO_SECURITY)); assertThrowsIllegalArg(() -> test.repoCurveDiscountFactors(ID_ISSUER, GBP)); assertEquals(test.getValuationDate(), DATE); }