@Override
public EnergyFutureBean visitEnergyFutureSecurity(
EnergyFutureSecurity security) {
final EnergyFutureBean bean = createCommodityFutureBean(new EnergyFutureBean(), security);
ExternalId underlying = security.getUnderlyingId();
if (underlying != null) {
bean.setUnderlying(externalIdToExternalIdBean(underlying));
}
return bean;
}
@Override
public ForeignExchangeFutureBean visitFXFutureSecurity(
FXFutureSecurity security) {
final ForeignExchangeFutureBean bean = createFutureBean(new ForeignExchangeFutureBean(), security);
bean.setNumerator(secMasterSession
.getOrCreateCurrencyBean(security.getNumerator()
.getCode()));
bean.setDenominator(secMasterSession
.getOrCreateCurrencyBean(security.getDenominator()
.getCode()));
bean.setUnitNumber(security.getMultiplicationFactor());
return bean;
}
@Override
public InterestRateFutureBean visitInterestRateFutureSecurity(
InterestRateFutureSecurity security) {
final InterestRateFutureBean bean = createFutureBean(new InterestRateFutureBean(), security);
bean.setUnderlying(externalIdToExternalIdBean(security.getUnderlyingId()));
return bean;
}
@Override
public MetalFutureBean visitMetalFutureSecurity(
MetalFutureSecurity security) {
final MetalFutureBean bean = createCommodityFutureBean(new MetalFutureBean(), security);
ExternalId underlying = security.getUnderlyingId();
if (underlying != null) {
bean.setUnderlying(externalIdToExternalIdBean(security.getUnderlyingId()));
}
return bean;
}