protected ValueRequirement getMarketDataRequirement(FinancialSecurity security) {
if (security instanceof FXBarrierOptionSecurity) {
final FXBarrierOptionSecurity barrierOption = (FXBarrierOptionSecurity) security;
return ConventionBasedFXRateFunction.getSpotRateRequirement(barrierOption.getCallCurrency(), barrierOption.getPutCurrency());
} else if (security instanceof FXDigitalOptionSecurity) {
final FXDigitalOptionSecurity digitalOption = (FXDigitalOptionSecurity) security;
return ConventionBasedFXRateFunction.getSpotRateRequirement(digitalOption.getCallCurrency(), digitalOption.getPutCurrency());
} else {
throw new OpenGammaRuntimeException("Got unexpected security type " + security);
}
}