diff options
author | 2023-06-07 11:02:30 +0100 | |
---|---|---|
committer | 2023-06-07 11:02:50 +0100 | |
commit | 195d3d7bbed40ff1ed6659e6864a5695356a400b (patch) | |
tree | fddd68d3f5ee65974fcf93c2860b39ad503358c3 /cps-ncmp-service/src | |
parent | c7e243ad790ae0bf3957a486a59d81374ba89075 (diff) |
Fix some code smells
Issue-ID: CPS-1507
Change-Id: Ic11ccbb37538242cb65ab1dbdde4fc77d9f94bdf
Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'cps-ncmp-service/src')
2 files changed, 7 insertions, 7 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java index 2466bc36e..136c1d6ff 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java @@ -54,7 +54,7 @@ public interface SubscriptionOutcomeMapper { default List<Object> mapStatusToCmHandleRejected(Map<String, SubscriptionStatus> targets) { return targets.entrySet() .stream().filter(target -> SubscriptionStatus.REJECTED.equals(target.getValue())) - .map(target -> target.getKey()) + .map(Map.Entry::getKey) .collect(Collectors.toList()); } @@ -68,7 +68,7 @@ public interface SubscriptionOutcomeMapper { default List<Object> mapStatusToCmHandleAccepted(Map<String, SubscriptionStatus> targets) { return targets.entrySet() .stream().filter(target -> SubscriptionStatus.ACCEPTED.equals(target.getValue())) - .map(target -> target.getKey()) + .map(Map.Entry::getKey) .collect(Collectors.toList()); } @@ -82,7 +82,7 @@ public interface SubscriptionOutcomeMapper { default List<Object> mapStatusToCmHandlePending(Map<String, SubscriptionStatus> targets) { return targets.entrySet() .stream().filter(target -> SubscriptionStatus.PENDING.equals(target.getValue())) - .map(target -> target.getKey()) + .map(Map.Entry::getKey) .collect(Collectors.toList()); } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java index 2fec59b73..1648ac4fb 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java @@ -53,7 +53,7 @@ public class DataNodeHelper { public static List<Map<String, Serializable>> getDataNodeLeaves(final Collection<DataNode> dataNodes) { return dataNodes.stream() .flatMap(DataNodeHelper::flatten) - .map(node -> node.getLeaves()) + .map(DataNode::getLeaves) .collect(Collectors.toList()); } @@ -66,10 +66,10 @@ public class DataNodeHelper { public static List<Collection<Serializable>> getCmHandleIdToStatus( final List<Map<String, Serializable>> dataNodeLeaves) { return dataNodeLeaves.stream() - .map(target -> target.values()) + .map(Map::values) .filter(col -> col.contains("PENDING") - | col.contains("ACCEPTED") - | col.contains("REJECTED")) + || col.contains("ACCEPTED") + || col.contains("REJECTED")) .collect(Collectors.toList()); } } |