public void test_builder() { BondFutureOption test = sut(); assertEquals(test.getPutCall(), CALL); assertEquals(test.getStrikePrice(), STRIKE_PRICE); assertEquals(test.getExpiryDate(), EXPIRY_DATE); assertEquals(test.getExpiryTime(), EXPIRY_TIME); assertEquals(test.getExpiryZone(), EXPIRY_ZONE); assertEquals(test.getExpiry(), ZonedDateTime.of(EXPIRY_DATE, EXPIRY_TIME, EXPIRY_ZONE)); assertEquals(test.getRounding(), Rounding.none()); assertEquals(test.getUnderlyingFuture(), FUTURE); assertEquals(test.getCurrency(), FUTURE.getCurrency()); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 1574023291: // securityId return ((BondFutureOption) bean).getSecurityId(); case -219971059: // putCall return ((BondFutureOption) bean).getPutCall(); case 50946231: // strikePrice return ((BondFutureOption) bean).getStrikePrice(); case -816738431: // expiryDate return ((BondFutureOption) bean).getExpiryDate(); case -816254304: // expiryTime return ((BondFutureOption) bean).getExpiryTime(); case -816069761: // expiryZone return ((BondFutureOption) bean).getExpiryZone(); case -1257652838: // premiumStyle return ((BondFutureOption) bean).getPremiumStyle(); case -142444: // rounding return ((BondFutureOption) bean).getRounding(); case -165476480: // underlyingFuture return ((BondFutureOption) bean).getUnderlyingFuture(); } return super.propertyGet(bean, propertyName, quiet); }
/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(BondFutureOption beanToCopy) { this.securityId = beanToCopy.getSecurityId(); this.putCall = beanToCopy.getPutCall(); this.strikePrice = beanToCopy.getStrikePrice(); this.expiryDate = beanToCopy.getExpiryDate(); this.expiryTime = beanToCopy.getExpiryTime(); this.expiryZone = beanToCopy.getExpiryZone(); this.premiumStyle = beanToCopy.getPremiumStyle(); this.rounding = beanToCopy.getRounding(); this.underlyingFuture = beanToCopy.getUnderlyingFuture(); }
static BondFutureOptionSecurity sut() { return BondFutureOptionSecurity.builder() .info(INFO) .currency(PRODUCT.getCurrency()) .putCall(CALL) .strikePrice(PRODUCT.getStrikePrice()) .expiryDate(PRODUCT.getExpiryDate()) .expiryTime(PRODUCT.getExpiryTime()) .expiryZone(PRODUCT.getExpiryZone()) .premiumStyle(FutureOptionPremiumStyle.DAILY_MARGIN) .rounding(PRODUCT.getRounding()) .underlyingFutureId(PRODUCT.getUnderlyingFuture().getSecurityId()) .build(); }
static BondFutureOptionSecurity sut2() { return BondFutureOptionSecurity.builder() .info(INFO2) .currency(PRODUCT2.getCurrency()) .putCall(PUT) .strikePrice(PRODUCT2.getStrikePrice()) .expiryDate(PRODUCT2.getExpiryDate()) .expiryTime(PRODUCT2.getExpiryTime()) .expiryZone(PRODUCT2.getExpiryZone()) .premiumStyle(FutureOptionPremiumStyle.UPFRONT_PREMIUM) .rounding(PRODUCT2.getRounding()) .underlyingFutureId(PRODUCT2.getUnderlyingFuture().getSecurityId()) .build(); }