public void test_builder() { IborFutureOptionSecurity test = sut(); assertEquals(test.getInfo(), INFO); assertEquals(test.getSecurityId(), OPTION.getSecurityId()); assertEquals(test.getCurrency(), OPTION.getCurrency()); assertEquals(test.getPutCall(), OPTION.getPutCall()); assertEquals(test.getPremiumStyle(), OPTION.getPremiumStyle()); assertEquals(test.getUnderlyingFutureId(), FUTURE_ID); assertEquals(test.getUnderlyingIds(), ImmutableSet.of(FUTURE_ID)); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 1574023291: // securityId return ((IborFutureOption) bean).getSecurityId(); case -219971059: // putCall return ((IborFutureOption) bean).getPutCall(); case 50946231: // strikePrice return ((IborFutureOption) bean).getStrikePrice(); case -816738431: // expiryDate return ((IborFutureOption) bean).getExpiryDate(); case -816254304: // expiryTime return ((IborFutureOption) bean).getExpiryTime(); case -816069761: // expiryZone return ((IborFutureOption) bean).getExpiryZone(); case -1257652838: // premiumStyle return ((IborFutureOption) bean).getPremiumStyle(); case -142444: // rounding return ((IborFutureOption) bean).getRounding(); case -165476480: // underlyingFuture return ((IborFutureOption) bean).getUnderlyingFuture(); } return super.propertyGet(bean, propertyName, quiet); }
/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(IborFutureOption 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(); }
public void test_builder() { ResolvedIborFutureOption test = sut(); assertEquals(test.getSecurityId(), PRODUCT.getSecurityId()); assertEquals(test.getPutCall(), PRODUCT.getPutCall()); assertEquals(test.getStrikePrice(), PRODUCT.getStrikePrice()); assertEquals(test.getPremiumStyle(), PRODUCT.getPremiumStyle()); assertEquals(test.getExpiry(), PRODUCT.getExpiry()); assertEquals(test.getExpiryDate(), PRODUCT.getExpiryDate()); assertEquals(test.getRounding(), PRODUCT.getRounding()); assertEquals(test.getUnderlyingFuture(), PRODUCT.getUnderlyingFuture().resolve(REF_DATA)); assertEquals(test.getIndex(), PRODUCT.getUnderlyingFuture().getIndex()); }
static IborFutureOptionSecurity sut() { return IborFutureOptionSecurity.builder() .info(INFO) .currency(OPTION.getCurrency()) .putCall(OPTION.getPutCall()) .strikePrice(OPTION.getStrikePrice()) .expiryDate(OPTION.getExpiryDate()) .expiryTime(OPTION.getExpiryTime()) .expiryZone(OPTION.getExpiryZone()) .premiumStyle(OPTION.getPremiumStyle()) .rounding(OPTION.getRounding()) .underlyingFutureId(FUTURE_ID) .build(); }
static IborFutureOptionSecurity sut2() { return IborFutureOptionSecurity.builder() .info(INFO2) .currency(OPTION2.getCurrency()) .putCall(OPTION2.getPutCall()) .strikePrice(OPTION2.getStrikePrice()) .expiryDate(OPTION2.getExpiryDate()) .expiryTime(OPTION2.getExpiryTime()) .expiryZone(OPTION2.getExpiryZone()) .premiumStyle(OPTION2.getPremiumStyle()) .rounding(OPTION2.getRounding()) .underlyingFutureId(FUTURE_ID2) .build(); }