diff options
Diffstat (limited to 'common-logging/src/main/java/org/onap/policy/common/logging/eelf/EventTrackInfo.java')
-rw-r--r-- | common-logging/src/main/java/org/onap/policy/common/logging/eelf/EventTrackInfo.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/EventTrackInfo.java b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/EventTrackInfo.java index 71476c6a..f6f38d0d 100644 --- a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/EventTrackInfo.java +++ b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/EventTrackInfo.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-Logging * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +22,14 @@ package org.onap.policy.common.logging.eelf; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import lombok.Getter; /** * EventTrackInfo contains a ConcurrentHashMap of EventData. */ public class EventTrackInfo { + @Getter private final ConcurrentMap<String, EventData> eventInfo; /** @@ -66,9 +68,7 @@ public class EventTrackInfo { return; } // in case override the start time, check the original event was already stored or not - if (!eventInfo.containsKey(id)) { - eventInfo.put(id, event); - } + eventInfo.putIfAbsent(id, event); } } @@ -82,11 +82,4 @@ public class EventTrackInfo { eventInfo.remove(eventId); } } - - /** - * Returns a ConcurrentHashMap of EventData. - */ - public ConcurrentMap<String, EventData> getEventInfo() { - return eventInfo; - } } |