public void test_builder() { FixedCouponBond test = sut(); assertEquals(test.getSecurityId(), SECURITY_ID); assertEquals(test.getDayCount(), DAY_COUNT); assertEquals(test.getFixedRate(), FIXED_RATE); assertEquals(test.getLegalEntityId(), LEGAL_ENTITY); assertEquals(test.getCurrency(), EUR); assertEquals(test.getNotional(), NOTIONAL); assertEquals(test.getAccrualSchedule(), PERIOD_SCHEDULE); assertEquals(test.getSettlementDateOffset(), DATE_OFFSET); assertEquals(test.getYieldConvention(), YIELD_CONVENTION); assertEquals(test.getExCouponPeriod(), EX_COUPON); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 1574023291: // securityId return ((FixedCouponBond) bean).getSecurityId(); case 575402001: // currency return ((FixedCouponBond) bean).getCurrency(); case 1585636160: // notional return ((FixedCouponBond) bean).getNotional(); case 304659814: // accrualSchedule return ((FixedCouponBond) bean).getAccrualSchedule(); case 747425396: // fixedRate return ((FixedCouponBond) bean).getFixedRate(); case 1905311443: // dayCount return ((FixedCouponBond) bean).getDayCount(); case -1895216418: // yieldConvention return ((FixedCouponBond) bean).getYieldConvention(); case 866287159: // legalEntityId return ((FixedCouponBond) bean).getLegalEntityId(); case 135924714: // settlementDateOffset return ((FixedCouponBond) bean).getSettlementDateOffset(); case 1408037338: // exCouponPeriod return ((FixedCouponBond) bean).getExCouponPeriod(); } return super.propertyGet(bean, propertyName, quiet); }
/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(FixedCouponBond beanToCopy) { this.securityId = beanToCopy.getSecurityId(); this.currency = beanToCopy.getCurrency(); this.notional = beanToCopy.getNotional(); this.accrualSchedule = beanToCopy.getAccrualSchedule(); this.fixedRate = beanToCopy.getFixedRate(); this.dayCount = beanToCopy.getDayCount(); this.yieldConvention = beanToCopy.getYieldConvention(); this.legalEntityId = beanToCopy.getLegalEntityId(); this.settlementDateOffset = beanToCopy.getSettlementDateOffset(); this.exCouponPeriod = beanToCopy.getExCouponPeriod(); }
static FixedCouponBondSecurity createSecurity(FixedCouponBond product) { return FixedCouponBondSecurity.builder() .info(SecurityInfo.of(product.getSecurityId(), INFO.getPriceInfo())) .currency(product.getCurrency()) .notional(product.getNotional()) .accrualSchedule(product.getAccrualSchedule()) .fixedRate(product.getFixedRate()) .dayCount(product.getDayCount()) .yieldConvention(product.getYieldConvention()) .legalEntityId(product.getLegalEntityId()) .settlementDateOffset(product.getSettlementDateOffset()) .exCouponPeriod(product.getExCouponPeriod()) .build(); }