public virtual void test_builder()
        {
            RatesCurveInputs test = RatesCurveInputs.builder().marketData(DATA_MAP).curveMetadata(METADATA).build();

            assertThat(test.MarketData).isEqualTo(DATA_MAP);
            assertThat(test.CurveMetadata).isEqualTo(METADATA);
        }
Beispiel #2
0
 /// <summary>
 /// Returns the inputs required for the curve if available.
 /// <para>
 /// If no market data is required to build the curve an empty set of inputs is returned.
 /// If the curve requires inputs which are available in {@code marketData} they are returned.
 /// If the curve requires inputs which are not available in {@code marketData} an exception is thrown
 ///
 /// </para>
 /// </summary>
 /// <param name="curveDefn">  the curve definition </param>
 /// <param name="marketData">  the market data </param>
 /// <param name="groupName">  the name of the curve group being built </param>
 /// <param name="obsSource">  the source of the observable market data </param>
 /// <returns> the input data required for the curve if available </returns>
 private MarketDataBox <RatesCurveInputs> curveInputs(CurveDefinition curveDefn, ScenarioMarketData marketData, CurveGroupName groupName, ObservableSource obsSource)
 {
     // only try to get inputs from the market data if the curve needs market data
     if (requiresMarketData(curveDefn))
     {
         RatesCurveInputsId curveInputsId = RatesCurveInputsId.of(groupName, curveDefn.Name, obsSource);
         return(marketData.getValue(curveInputsId));
     }
     else
     {
         return(MarketDataBox.ofSingleValue(RatesCurveInputs.builder().build()));
     }
 }