BloombergDataUtils { public static Map<String, String> getBUID(final ReferenceDataProvider refDataProvider, final Set<String> bloombergKeys) { return refDataProvider.getReferenceDataValues(bloombergKeys, FIELD_ID_BBG_UNIQUE); } private  BloombergDataUtils(); static Collection<NormalizationRuleSet> getDefaultNormalizationRules(final ReferenceDataProvider referenceDataProvider, final CacheManager cacheManager, ExternalScheme bbgScheme); static HistoricalTimeSeriesFieldAdjustmentMap createFieldAdjustmentMap(final ReferenceDataProvider referenceDataProvider, final CacheManager cacheManager); static MarketDataAvailabilityFilter createAvailabilityFilter(); static FudgeMsg parseElement(final Element element); static Object parseValue(final Element valueElement); static String getSingleBUID(final ReferenceDataProvider refDataProvider, final String securityDes); static Map<String, String> getBUID(final ReferenceDataProvider refDataProvider, final Set<String> bloombergKeys); static Set<String> getIndexMembers(final ReferenceDataProvider refDataProvider, final String indexTicker); static Set<ExternalId> getOptionChain(final ReferenceDataProvider refDataProvider, final String securityID); static Set<ExternalId> getFuturechain(final ReferenceDataProvider refDataProvider, final String securityID); static boolean isValidField(final String name); static ExternalIdBundleWithDates parseIdentifiers(final FudgeMsg fieldData, final String firstTradeDateField, final String lastTradeDateField); static ExternalIdBundleWithDates addTwoDigitYearCode(final ExternalIdBundleWithDates bundleWithDates); static Set<ExternalIdBundle> getCurrentIdentifiers(final PositionMaster positionMaster); static String removeDuplicateWhiteSpace(final String field, final String replacement); static Set<ExternalId> identifierLoader(final Reader reader); static BiMap<String, ExternalIdBundle> convertToBloombergBuidKeys(final Collection<ExternalIdBundle> identifiers, final ReferenceDataProvider refDataProvider); static Pair<String, String> splitTickerAtMarketSector(final String ticker); static boolean isValidBloombergTicker(final String ticker); static ExternalId generateEquityOptionTicker(final String underlyingTicker, final Expiry expiry, final OptionType optionType, final double strike); static String dateToBbgCode(final LocalDate date); static ExternalId ricToBbgFuture(final String ric); static ExternalId ricToBbgFutureOption(final String ric, final boolean isCall, final double strike, final LocalDate expiry); static ExternalId futureBundleToGenericFutureTicker(ExternalIdBundle bundle, ZonedDateTime now, OffsetTime futureExpiryTime, ZoneId futureExpiryTimeZone); static String resolveDataProvider(final String dataProvider); static String resolveObservationTime(String dataProvider); static String toBloombergDate(LocalDate localDate); static String futureMonthCode(final Month month); static final List<String> STANDARD_FIELDS_LIST; static final Set<String> STANDARD_FIELDS_SET; }
@Test public void getBUID() throws Exception { MockReferenceDataProvider rdp = new MockReferenceDataProvider(); rdp.addExpectedField(FIELD_ID_BBG_UNIQUE); rdp.addResult("FIRST US Equity", FIELD_ID_BBG_UNIQUE, "EQ1234"); rdp.addResult("SECOND US Equity", FIELD_ID_BBG_UNIQUE, "EQ4321"); Map<String, String> buids = BloombergDataUtils.getBUID(rdp, Sets.newHashSet("FIRST US Equity", "SECOND US Equity")); assertNotNull(buids); assertEquals(2, buids.size()); assertEquals("EQ1234", buids.get("FIRST US Equity")); assertEquals("EQ4321", buids.get("SECOND US Equity")); }