final String volatilityFunctionName = message.getString(VOLATILITY_MODEL_FIELD_NAME);
final String weightingFunctionName = message.getString(WEIGHTING_FUNCTION_FIELD_NAME);
final boolean externalBeta = message.getBoolean(EXTERNAL_BETA_FIELD_NAME);
@SuppressWarnings("unchecked")
final VolatilityFunctionProvider<SABRFormulaData> model = (VolatilityFunctionProvider<SABRFormulaData>) VolatilityFunctionFactory.getCalculator(volatilityFunctionName);
final WeightingFunction weightingFunction = WeightingFunctionFactory.getWeightingFunction(weightingFunctionName);
if (externalBeta) {
final double beta = message.getDouble(BETA_FIELD_NAME);
return new SmileInterpolatorSABR(model, beta, weightingFunction);
}
return new SmileInterpolatorSABR(model, weightingFunction);