/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(EtdFutureSecurity beanToCopy) { this.info = beanToCopy.getInfo(); this.contractSpecId = beanToCopy.getContractSpecId(); this.expiry = beanToCopy.getExpiry(); this.variant = beanToCopy.getVariant(); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 3237038: // info return ((EtdFutureSecurity) bean).getInfo(); case 948987368: // contractSpecId return ((EtdFutureSecurity) bean).getContractSpecId(); case -1289159373: // expiry return ((EtdFutureSecurity) bean).getExpiry(); case 236785797: // variant return ((EtdFutureSecurity) bean).getVariant(); } return super.propertyGet(bean, propertyName, quiet); }
public void createFutureAutoId() { EtdFutureSecurity security = FUTURE_CONTRACT.createFuture(YearMonth.of(2015, 6), EtdVariant.MONTHLY); assertThat(security.getSecurityId()).isEqualTo(SecurityId.of(EtdIdUtils.ETD_SCHEME, "F-ECAG-FOO-201506")); assertThat(security.getExpiry()).isEqualTo(YearMonth.of(2015, 6)); assertThat(security.getContractSpecId()).isEqualTo(FUTURE_CONTRACT.getId()); assertThat(security.getVariant()).isEqualTo(EtdVariant.MONTHLY); assertThat(security.getInfo().getPriceInfo()).isEqualTo(FUTURE_CONTRACT.getPriceInfo()); }