);
}
@Override
public FutureSecurity visitFXFutureType(ForeignExchangeFutureBean bean) {
final FXFutureSecurity security = new FXFutureSecurity(
expiryBeanToExpiry(bean.getExpiry()), bean
.getTradingExchange().getName(), bean
.getSettlementExchange().getName(),
currencyBeanToCurrency(bean.getCurrency()),
bean.getUnitAmount(),
currencyBeanToCurrency(bean.getNumerator()),
currencyBeanToCurrency(bean.getDenominator()),
bean.getCategory().getName());
security.setMultiplicationFactor(bean.getUnitNumber());
return security;
}
@Override
public FutureSecurity visitInterestRateFutureType(InterestRateFutureBean bean) {
return new InterestRateFutureSecurity(
expiryBeanToExpiry(bean.getExpiry()),
bean.getTradingExchange().getName(),
bean.getSettlementExchange().getName(),
currencyBeanToCurrency(bean.getCurrency()),
bean.getUnitAmount(),
externalIdBeanToExternalId(bean.getUnderlying()),
bean.getCategory().getName());
}
@Override
public FutureSecurity visitAgricultureFutureType(AgricultureFutureBean bean) {
final AgricultureFutureSecurity security = new AgricultureFutureSecurity(
expiryBeanToExpiry(bean.getExpiry()),
bean.getTradingExchange().getName(),
bean.getSettlementExchange().getName(),
currencyBeanToCurrency(bean.getCurrency()),
bean.getUnitAmount(),
bean.getCategory().getName());
security.setUnitNumber(bean.getUnitNumber());
if (bean.getUnitName() != null) {
security.setUnitName(bean.getUnitName().getName());
}
return security;
}
@Override
public FutureSecurity visitEnergyFutureType(EnergyFutureBean bean) {
final EnergyFutureSecurity security = new EnergyFutureSecurity(
expiryBeanToExpiry(bean.getExpiry()),
bean.getTradingExchange().getName(),
bean.getSettlementExchange().getName(),
currencyBeanToCurrency(bean.getCurrency()),
bean.getUnitAmount(),
bean.getCategory().getName());
security.setUnitNumber(bean.getUnitNumber());
if (bean.getUnitName() != null) {
security.setUnitName(bean.getUnitName().getName());
}
security.setUnderlyingId(externalIdBeanToExternalId(bean
.getUnderlying()));
return security;
}
@Override
public FutureSecurity visitMetalFutureType(MetalFutureBean bean) {
final MetalFutureSecurity security = new MetalFutureSecurity(
expiryBeanToExpiry(bean.getExpiry()),
bean.getTradingExchange().getName(),
bean.getSettlementExchange().getName(),
currencyBeanToCurrency(bean.getCurrency()),
bean.getUnitAmount(),
bean.getCategory().getName());
security.setUnitNumber(bean.getUnitNumber());
if (bean.getUnitName() != null) {
security.setUnitName(bean.getUnitName().getName());
}
security.setUnderlyingId(externalIdBeanToExternalId(bean
.getUnderlying()));
return security;
}
@Override
public FutureSecurity visitIndexFutureType(IndexFutureBean bean) {
final IndexFutureSecurity security = new IndexFutureSecurity(
expiryBeanToExpiry(bean.getExpiry()),
bean.getTradingExchange().getName(),
bean.getSettlementExchange().getName(),
currencyBeanToCurrency(bean.getCurrency()),
bean.getUnitAmount(),
bean.getCategory().getName());
security.setUnderlyingId(externalIdBeanToExternalId(bean
.getUnderlying()));
return security;
}
@Override
public FutureSecurity visitStockFutureType(StockFutureBean bean) {
final StockFutureSecurity security = new StockFutureSecurity(
expiryBeanToExpiry(bean.getExpiry()),
bean.getTradingExchange().getName(),
bean.getSettlementExchange().getName(),
currencyBeanToCurrency(bean.getCurrency()),
bean.getUnitAmount(),
bean.getCategory().getName());
security.setUnderlyingId(externalIdBeanToExternalId(bean
.getUnderlying()));
return security;
}
@Override