public final class ImmutableMarketData extends Object implements MarketData, org.joda.beans.ImmutableBean, Serializable
This is the standard immutable implementation of MarketData.
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableMarketData.Meta
The meta-bean for
ImmutableMarketData. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableMarketDataBuilder |
builder(LocalDate valuationDate)
Creates a builder that can be used to build an instance of
MarketData. |
ImmutableMarketData |
combinedWith(ImmutableMarketData other)
Combines this set of market data with another.
|
MarketData |
combinedWith(MarketData other)
Combines this market data with another.
|
boolean |
containsValue(MarketDataId<?> id)
Checks if this market data contains a value for the specified identifier.
|
boolean |
equals(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.
|
ImmutableMap<ObservableId,LocalDateDoubleTimeSeries> |
getTimeSeries()
Gets the time-series.
|
LocalDateDoubleTimeSeries |
getTimeSeries(ObservableId id)
Gets the time-series identified by the specified identifier, empty if not found.
|
Set<ObservableId> |
getTimeSeriesIds()
Gets the time-series identifiers.
|
LocalDate |
getValuationDate()
Gets the valuation date associated with the market data.
|
<T> T |
getValue(MarketDataId<T> id)
Gets the market data value associated with the specified identifier.
|
ImmutableMap<MarketDataId<?>,Object> |
getValues()
Gets the market data values.
|
int |
hashCode() |
static ImmutableMarketData.Meta |
meta()
The meta-bean for
ImmutableMarketData. |
ImmutableMarketData.Meta |
metaBean() |
static ImmutableMarketData |
of(LocalDate valuationDate,
Map<? extends MarketDataId<?>,?> values)
Obtains an instance from a valuation date and map of values.
|
ImmutableMarketDataBuilder |
toBuilder()
Returns a builder populated with the same data as this instance.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitempty, of, withValuepublic static ImmutableMarketData of(LocalDate valuationDate, Map<? extends MarketDataId<?>,?> values)
Use the builder for more more complex use cases, including setting time-series.
of in interface MarketDatavaluationDate - the valuation date associated with the market datavalues - the market data valuesClassCastException - if a value does not match the parameterized type associated with the identifierpublic static ImmutableMarketDataBuilder builder(LocalDate valuationDate)
MarketData.valuationDate - the valuation datepublic ImmutableMarketDataBuilder toBuilder()
public boolean containsValue(MarketDataId<?> id)
MarketDatacontainsValue in interface MarketDataid - the identifier to findpublic ImmutableMarketData combinedWith(ImmutableMarketData other)
The result combines both sets of market data. Values are taken from this set of market data if available, otherwise they are taken from the other set.
The valuation dates of the sets of market data must be the same.
other - the other market datapublic MarketData combinedWith(MarketData other)
MarketDataThe result combines both sets of market data. Values are taken from this set of market data if available, otherwise they are taken from the other set.
The valuation dates of the sets of market data must be the same.
combinedWith in interface MarketDataother - the other market datapublic <T> T getValue(MarketDataId<T> id)
MarketDataIf this market data instance contains the identifier, the value will be returned. Otherwise, an exception will be thrown.
getValue in interface MarketDataT - the type of the market data valueid - the identifier to findpublic <T> Optional<T> findValue(MarketDataId<T> id)
MarketDataIf this market data instance contains the identifier, the value will be returned. Otherwise, an empty optional will be returned.
findValue in interface MarketDataT - the type of the market data valueid - the identifier to findpublic Set<MarketDataId<?>> getIds()
MarketDatagetIds in interface MarketDatapublic <T> Set<MarketDataId<T>> findIds(MarketDataName<T> name)
MarketDataThis 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.
findIds in interface MarketDataT - the type of the market data valuename - the name to findpublic Set<ObservableId> getTimeSeriesIds()
MarketDatagetTimeSeriesIds in interface MarketDatapublic LocalDateDoubleTimeSeries getTimeSeries(ObservableId id)
MarketDatagetTimeSeries in interface MarketDataid - the identifier to findpublic static ImmutableMarketData.Meta meta()
ImmutableMarketData.public ImmutableMarketData.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic LocalDate getValuationDate()
getValuationDate in interface MarketDatapublic ImmutableMap<MarketDataId<?>,Object> getValues()
public ImmutableMap<ObservableId,LocalDateDoubleTimeSeries> getTimeSeries()
If a request is made for a time-series that is not in the map, an empty series will be returned.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.