class RatesCurveGroupMarketDataFunction implements MarketDataFunction<RatesCurveGroup, RatesCurveGroupId> {

  @Override
  public MarketDataRequirements requirements(RatesCurveGroupId id, MarketDataConfig marketDataConfig) {
    RatesCurveGroupDefinition groupDefn = marketDataConfig.get(RatesCurveGroupDefinition.class, id.getCurveGroupName());

    // request input data for any curves that need market data
    // no input data is requested if the curve definition contains all the market data needed to build the curve
    List<RatesCurveInputsId> curveInputsIds = groupDefn.getCurveDefinitions().stream()
        .filter(defn -> requiresMarketData(defn))
        .map(defn -> defn.getName())
        .map(curveName -> RatesCurveInputsId.of(groupDefn.getName(), curveName, id.getObservableSource()))
        .collect(toImmutableList());
    List<ObservableId> timeSeriesIds = groupDefn.getEntries().stream()
        .flatMap(entry -> entry.getIndices().stream())
        .distinct()
        .map(index -> IndexQuoteId.of(index))
        .collect(toImmutableList());
    return MarketDataRequirements.builder()
        .addValues(curveInputsIds)
        .addTimeSeries(timeSeriesIds)
        .build();
  }

  public  RatesCurveGroupMarketDataFunction();
  public  RatesCurveGroupMarketDataFunction(CalibrationMeasures calibrationMeasures);

}