- これはマルチスレッド化されています
- HashMap に関するトピックを読みましたが、関連する質問/回答が見つかりません
コード:
private Map<String, String> eventsForThisCategory;
...
Map<String, String> getEventsForThisCategory() {
if (eventsForThisCategory == null) {
Collection<INotificationEventsObj> notificationEvents = notificationEventsIndex.getCategoryNotificationEvents(getCategoryId());
eventsForThisCategory = new HashMap<String, String>();
for(INotificationEventsObj notificationEvent : notificationEvents) {
eventsForThisCategory.put(notificationEvent.getNotificationEventID(), notificationEvent.getNotificationEventName());
}
logger.debug("eventsForThisCategory is {}", eventsForThisCategory);
}
return eventsForThisCategory;
}
出力:
app_debug.9.log.gz:07 2016 年 4 月 13:47:06,661 DEBUG [WirePushNotificationSyncHandler::WirePushNotification.Worker-1] - eventsForThisCategory は {FX_WIRE_DATA=主要経済データ、ALL_FX_WIRE=すべて、ALL_FX_WIRE=すべて、FX_WIRE_HEADLINES=重要な見出し}
それはどのように可能ですか?