Class QuoteId

  • All Implemented Interfaces:
    MarketDataId<Double>, ObservableId, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class QuoteId
    extends Object
    implements ObservableId, org.joda.beans.ImmutableBean, Serializable
    An identifier used to access a market quote.

    A quote ID identifies a piece of data in an external data provider.

    Where possible, applications should use higher level IDs, instead of this class. Higher level market data keys allow the system to associate the market data with metadata when applying scenario definitions. If quote IDs are used directly, the system has no way to perturb the market data using higher level rules that rely on metadata.

    The StandardId in a quote ID is typically the ID from an underlying data provider (e.g. Bloomberg or Reuters). However the field name is a generic name which is mapped to the field name in the underlying provider by the market data system.

    The reason for this difference is the different sources of the ID and field name data. The ID is typically taken from an object which is provided to any calculations, for example a security linked to the trade. The calculation rarely has to make up an ID for an object it doesn't have access to.

    In contrast, calculations will often have to reference field names that aren't part their arguments. For example, if a calculation requires the last closing price of a security, it could take the ID from the security, but it needs a way to specify the field name containing the last closing price.

    If the field name were specific to the market data provider, the calculation would have to be aware of the source of its market data. However, if it uses a generic field name from FieldNames the market data source can change without affecting the calculation.

    See Also:
    FieldName, Serialized Form
    • Method Detail

      • of

        public static QuoteId of​(StandardId standardId)
        Obtains an instance used to obtain an observable value.

        The field name containing the data is FieldName.MARKET_VALUE and the market data source is ObservableSource.NONE.

        Parameters:
        standardId - the standard identifier of the data in the underlying data provider
        Returns:
        the identifier
      • of

        public static QuoteId of​(StandardId standardId,
                                 FieldName fieldName)
        Obtains an instance used to obtain an observable value.

        The market data source is ObservableSource.NONE.

        Parameters:
        standardId - the standard identifier of the data in the underlying data provider
        fieldName - the name of the field in the market data record holding the data
        Returns:
        the identifier
      • of

        public static QuoteId of​(StandardId standardId,
                                 FieldName fieldName,
                                 ObservableSource obsSource)
        Obtains an instance used to obtain an observable value, specifying the source of observable market data.
        Parameters:
        standardId - the standard identifier of the data in the underlying data provider
        fieldName - the name of the field in the market data record holding the data
        obsSource - the source of observable market data
        Returns:
        the identifier
      • withObservableSource

        public QuoteId withObservableSource​(ObservableSource obsSource)
        Description copied from interface: ObservableId
        Returns an identifier equivalent to this with the specified source.
        Specified by:
        withObservableSource in interface ObservableId
        Parameters:
        obsSource - the source of market data
        Returns:
        the observable identifier
      • meta

        public static org.joda.beans.TypedMetaBean<QuoteId> meta()
        The meta-bean for QuoteId.
        Returns:
        the meta-bean, not null
      • metaBean

        public org.joda.beans.TypedMetaBean<QuoteId> metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getStandardId

        public StandardId getStandardId()
        Gets the identifier of the data. This is typically an identifier from an external data provider.
        Specified by:
        getStandardId in interface ObservableId
        Returns:
        the value of the property, not null
      • getFieldName

        public FieldName getFieldName()
        Gets the field name in the market data record that contains the market data item. The most common field name is market value.
        Specified by:
        getFieldName in interface ObservableId
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object