diff options
author | 2024-01-26 15:28:56 +0000 | |
---|---|---|
committer | 2024-02-09 10:31:15 +0000 | |
commit | cc1d3d352771d1fa35d297e90663539e34b022f6 (patch) | |
tree | b1b00d678b0157742b91be1262fbf614a62063b1 /policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java | |
parent | cce79248655f484e007769ba81b092148f940d27 (diff) |
Removing deprecated DMAAP library
Issue-ID: POLICY-4402
Change-Id: I4ce5b303cb3a775010683d3c7102b0bd065280ea
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java')
-rw-r--r-- | policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java b/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java index f3a422e7..76836ba2 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java +++ b/policy-management/src/main/java/org/onap/policy/drools/protocol/configuration/PdpdConfiguration.java @@ -3,6 +3,7 @@ * policy-management * ================================================================================ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +57,8 @@ public class PdpdConfiguration { @GsonJsonProperty("controllers") private List<ControllerConfiguration> controllers = new ArrayList<>(); - @GsonJsonIgnore private Map<String, Object> additionalProperties = new HashMap<>(); + @GsonJsonIgnore + private final Map<String, Object> additionalProperties = new HashMap<>(); /** * Constructor. @@ -163,32 +165,30 @@ public class PdpdConfiguration { } protected boolean declaredProperty(String name, Object value) { - switch (name) { - case "requestID": + return switch (name) { + case "requestID" -> { callSetRequestId(value); - return true; - case "entity": + yield true; + } + case "entity" -> { callSetEntity(value); - return true; - case "controllers": + yield true; + } + case "controllers" -> { callSetControllers(value); - return true; - default: - return false; - } + yield true; + } + default -> false; + }; } protected Object declaredPropertyOrNotFound(String name, Object notFoundValue) { - switch (name) { - case "requestID": - return getRequestId(); - case "entity": - return getEntity(); - case "controllers": - return getControllers(); - default: - return notFoundValue; - } + return switch (name) { + case "requestID" -> getRequestId(); + case "entity" -> getEntity(); + case "controllers" -> getControllers(); + default -> notFoundValue; + }; } /** @@ -273,7 +273,7 @@ public class PdpdConfiguration { "property \"controllers\" is of type " + "\"java.util.List<org.onap.policy.drools.protocol.configuration.Controller>\", " + "but got " - + value.getClass().toString()); + + value.getClass()); } } } |