private LocalDate calculateSettlementDate(ReferenceData refData) { if (info.getSettlementDate().isPresent()) { return info.getSettlementDate().get(); } LocalDate tradeDate = info.getTradeDate().get(); return product.getSettlementDateOffset().adjust(tradeDate, refData); }
/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(Bill beanToCopy) { this.securityId = beanToCopy.getSecurityId(); this.notional = beanToCopy.getNotional(); this.dayCount = beanToCopy.getDayCount(); this.yieldConvention = beanToCopy.getYieldConvention(); this.legalEntityId = beanToCopy.getLegalEntityId(); this.settlementDateOffset = beanToCopy.getSettlementDateOffset(); }
public void test_builder() { assertEquals(US_BILL.getCurrency(), CCY); assertEquals(US_BILL.getDayCount(), DAY_COUNT); assertEquals(US_BILL.getLegalEntityId(), LEGAL_ENTITY); assertEquals(US_BILL.getNotional(), NOTIONAL); assertEquals(US_BILL.getSecurityId(), SECURITY_ID); assertEquals(US_BILL.getSettlementDateOffset(), SETTLE); assertEquals(US_BILL.getYieldConvention(), YIELD_CONVENTION); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 1574023291: // securityId return ((Bill) bean).getSecurityId(); case 1585636160: // notional return ((Bill) bean).getNotional(); case 1905311443: // dayCount return ((Bill) bean).getDayCount(); case -1895216418: // yieldConvention return ((Bill) bean).getYieldConvention(); case 866287159: // legalEntityId return ((Bill) bean).getLegalEntityId(); case 135924714: // settlementDateOffset return ((Bill) bean).getSettlementDateOffset(); } return super.propertyGet(bean, propertyName, quiet); }
public void test_getters() { ResolvedBill test = sut(); assertEquals(test.getSecurityId(), BillTest.US_BILL.getSecurityId()); assertEquals(test.getCurrency(), BillTest.US_BILL.getCurrency()); assertEquals(test.getNotional(), BillTest.US_BILL.getNotional().resolve(REF_DATA)); assertEquals(test.getDayCount(), BillTest.US_BILL.getDayCount()); assertEquals(test.getYieldConvention(), BillTest.US_BILL.getYieldConvention()); assertEquals(test.getLegalEntityId(), BillTest.US_BILL.getLegalEntityId()); assertEquals(test.getSettlementDateOffset(), BillTest.US_BILL.getSettlementDateOffset()); }