Class BuiltMarketData
- java.lang.Object
-
- com.opengamma.strata.calc.marketdata.BuiltMarketData
-
- All Implemented Interfaces:
MarketData,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class BuiltMarketData extends Object implements MarketData, org.joda.beans.ImmutableBean
Market data that has been built.The
MarketDataFactorycan be used to build market data from external sources and by calibration. This implementation ofMarketDataprovides the result, and includes all the market data, such as quotes and curves.This implementation differs from
ImmutableMarketDatabecause it stores the failures that occurred during the build process. These errors are exposed to users when data is queried.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuiltMarketData.MetaThe meta-bean forBuiltMarketData.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsValue(MarketDataId<?> id)Checks if this market data contains a value for the specified identifier.booleanequals(Object obj)<T> Set<MarketDataId<T>>findIds(MarketDataName<T> name)Finds the market data identifiers associated with the specified name.<T> Optional<T>findValue(MarketDataId<T> id)Finds the market data value associated with the specified identifier.Set<MarketDataId<?>>getIds()Gets the market data identifiers.LocalDateDoubleTimeSeriesgetTimeSeries(ObservableId id)Gets the time-series identified by the specified identifier, empty if not found.ImmutableMap<MarketDataId<?>,Failure>getTimeSeriesFailures()Gets the failures that occurred when building time series of market data values.Set<ObservableId>getTimeSeriesIds()Gets the time-series identifiers.BuiltScenarioMarketDatagetUnderlying()Gets the underlying market data.LocalDategetValuationDate()Gets the valuation date of the market data.<T> TgetValue(MarketDataId<T> id)Gets the market data value associated with the specified identifier.ImmutableMap<MarketDataId<?>,Failure>getValueFailures()Gets the failures when building single market data values.inthashCode()static BuiltMarketData.Metameta()The meta-bean forBuiltMarketData.BuiltMarketData.MetametaBean()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.data.MarketData
combinedWith, withValue
-
-
-
-
Method Detail
-
getValuationDate
public LocalDate getValuationDate()
Description copied from interface:MarketDataGets the valuation date of the market data.All values accessible through this interface have the same valuation date.
- Specified by:
getValuationDatein interfaceMarketData- Returns:
- the valuation date
-
containsValue
public boolean containsValue(MarketDataId<?> id)
Description copied from interface:MarketDataChecks if this market data contains a value for the specified identifier.- Specified by:
containsValuein interfaceMarketData- Parameters:
id- the identifier to find- Returns:
- true if the market data contains a value for the identifier
-
getValue
public <T> T getValue(MarketDataId<T> id)
Description copied from interface:MarketDataGets the market data value associated with the specified identifier.If this market data instance contains the identifier, the value will be returned. Otherwise, an exception will be thrown.
- Specified by:
getValuein interfaceMarketData- Type Parameters:
T- the type of the market data value- Parameters:
id- the identifier to find- Returns:
- the market data value
-
findValue
public <T> Optional<T> findValue(MarketDataId<T> id)
Description copied from interface:MarketDataFinds the market data value associated with the specified identifier.If this market data instance contains the identifier, the value will be returned. Otherwise, an empty optional will be returned.
- Specified by:
findValuein interfaceMarketData- Type Parameters:
T- the type of the market data value- Parameters:
id- the identifier to find- Returns:
- the market data value, empty if not found
-
getIds
public Set<MarketDataId<?>> getIds()
Description copied from interface:MarketDataGets the market data identifiers.- Specified by:
getIdsin interfaceMarketData- Returns:
- the set of market data identifiers
-
findIds
public <T> Set<MarketDataId<T>> findIds(MarketDataName<T> name)
Description copied from interface:MarketDataFinds the market data identifiers associated with the specified name.This returns the unique identifiers that refer to the specified name. There may be more than one identifier associated with a name as the name is not unique.
- Specified by:
findIdsin interfaceMarketData- Type Parameters:
T- the type of the market data value- Parameters:
name- the name to find- Returns:
- the set of market data identifiers, empty if name not found
-
getTimeSeriesIds
public Set<ObservableId> getTimeSeriesIds()
Description copied from interface:MarketDataGets the time-series identifiers.- Specified by:
getTimeSeriesIdsin interfaceMarketData- Returns:
- the set of observable identifiers
-
getTimeSeries
public LocalDateDoubleTimeSeries getTimeSeries(ObservableId id)
Description copied from interface:MarketDataGets the time-series identified by the specified identifier, empty if not found.- Specified by:
getTimeSeriesin interfaceMarketData- Parameters:
id- the identifier to find- Returns:
- the time-series, empty if no time-series found
-
getValueFailures
public ImmutableMap<MarketDataId<?>,Failure> getValueFailures()
Gets the failures when building single market data values.- Returns:
- the single value failures
-
getTimeSeriesFailures
public ImmutableMap<MarketDataId<?>,Failure> getTimeSeriesFailures()
Gets the failures that occurred when building time series of market data values.- Returns:
- the time-series value failures
-
meta
public static BuiltMarketData.Meta meta()
The meta-bean forBuiltMarketData.- Returns:
- the meta-bean, not null
-
metaBean
public BuiltMarketData.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getUnderlying
public BuiltScenarioMarketData getUnderlying()
Gets the underlying market data.- Returns:
- the value of the property, not null
-
-