public final class ImmutableReferenceData extends Object implements ReferenceData, org.joda.beans.ImmutableBean, Serializable
This is the standard immutable implementation of ReferenceData.
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableReferenceData.Meta
The meta-bean for
ImmutableReferenceData. |
| Modifier and Type | Method and Description |
|---|---|
ReferenceData |
combinedWith(ReferenceData other)
Combines this reference data with another.
|
static ImmutableReferenceData |
empty()
Obtains an instance containing no reference data.
|
boolean |
equals(Object obj) |
ImmutableMap<ReferenceDataId<?>,Object> |
getValues()
Gets the typed reference data values by identifier.
|
int |
hashCode() |
static ImmutableReferenceData.Meta |
meta()
The meta-bean for
ImmutableReferenceData. |
ImmutableReferenceData.Meta |
metaBean() |
static ImmutableReferenceData |
of(Map<? extends ReferenceDataId<?>,?> values)
Obtains an instance from a map of reference data.
|
static <T> ImmutableReferenceData |
of(ReferenceDataId<T> id,
T value)
Obtains an instance from a single reference data entry.
|
<T> T |
queryValueOrNull(ReferenceDataId<T> id)
Low-level method to query the reference data value associated with the specified identifier,
returning null if not found.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsValue, findValue, getValue, minimal, standardpublic static ImmutableReferenceData of(Map<? extends ReferenceDataId<?>,?> values)
Each entry in the map is a single piece of reference data, keyed by the matching identifier.
For example, a HolidayCalendarId associated with a HolidayCalendar.
The caller must ensure that the each entry in the map corresponds with the parameterized
type on the identifier.
The resulting ImmutableReferenceData instance does not include the
minimal set of reference data that is essential for pricing.
To include the minimal set, use ReferenceData.of(Map) or combinedWith(ReferenceData).
of in interface ReferenceDatavalues - the reference data valuesClassCastException - if a value does not match the parameterized type associated with the identifierpublic static <T> ImmutableReferenceData of(ReferenceDataId<T> id, T value)
This returns an instance containing a single entry based on the specified identifier and value. This is primarily of interest to test cases.
The resulting ImmutableReferenceData instance does not include the
minimal set of reference data that is essential for pricing.
T - the type of the reference dataid - the identifiervalue - the reference data valuesClassCastException - if a value does not match the parameterized type associated with the identifierpublic static ImmutableReferenceData empty()
empty in interface ReferenceDatapublic <T> T queryValueOrNull(ReferenceDataId<T> id)
ReferenceData
This is a low-level method that obtains the reference data value, returning null instead of an error.
Applications should use ReferenceData.getValue(ReferenceDataId) in preference to this method.
queryValueOrNull in interface ReferenceDataT - the type of the reference data valueid - the identifier to findpublic ReferenceData combinedWith(ReferenceData other)
ReferenceDataThe result combines both sets of reference data. Values are taken from this set of reference data if available, otherwise they are taken from the other set.
combinedWith in interface ReferenceDataother - the other reference datapublic static ImmutableReferenceData.Meta meta()
ImmutableReferenceData.public ImmutableReferenceData.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ImmutableMap<ReferenceDataId<?>,Object> getValues()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.