diff options
author | Krishnajinka <kris.jinka@samsung.com> | 2018-08-07 09:07:47 +0900 |
---|---|---|
committer | krishnajinka <kris.jinka@samsung.com> | 2018-08-07 22:48:52 +0900 |
commit | 47c46108782dccd44101b772ba979e3fdf3ead04 (patch) | |
tree | 862d8c22101e9e427773afe684b8535ae6d48218 | |
parent | 7414584e40572c7854db959052c56f3cc8849488 (diff) |
Resolve sonar issue in Policy parameters
Fix sonar issue of Method has 9 parameters, which is
greater than 7 authorized in PolicyParameters class
and related test class.Rework2
Issue-ID: POLICY-1016
Change-Id: I3096566d958e093439bcc95d92f1fe92e0ac57be
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
3 files changed, 2064 insertions, 1903 deletions
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigParams.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigParams.java new file mode 100644 index 000000000..31427210e --- /dev/null +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigParams.java @@ -0,0 +1,160 @@ +/*- + * ============LICENSE_START======================================================= + * PolicyEngineAPI + * ================================================================================ + * Copyright (C) 2018 Samsung Electronics Co., Ltd. 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.policy.api; + +import java.util.Map; +import java.util.UUID; + +/** + * Policy config parameters representing the request object + */ +public class PolicyConfigParams { + //policyConfigType the {@link PolicyConfigType} Enum format of the Config Type + private PolicyConfigType policyConfigType; + + //policyName the <code>String</code> format of the Policy Name + private String policyName; + + //policyDescription the <code>String</code> format of the Policy Description + private String policyDescription; + + //onapName the <code>String</code> format of the ONAP Name + private String onapName; + + //configName the <code>String</code> format of the Config Name + private String configName; + + //attributes the <code>Map</code> Attributes that must contain the AttributeType and Map of key, + // value pairs corresponding to it. + private Map<AttributeType, Map<String, String>> attributes; + + //configBodyType the {@link PolicyType} Enum format of the config Body Type. + private PolicyType configBodyType; + + //configBody the <code>String</code> format of the Policy Body + private String configBody; + + //requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages. + private UUID requestID; + + private PolicyConfigParams() { + super(); + } + + PolicyConfigType getPolicyConfigType() { + return policyConfigType; + } + + public String getPolicyName() { + return policyName; + } + + public String getPolicyDescription() { + return policyDescription; + } + + public String getOnapName() { + return onapName; + } + + public String getConfigName() { + return configName; + } + + public Map<AttributeType, Map<String, String>> getAttributes() { + return attributes; + } + + PolicyType getConfigBodyType() { + return configBodyType; + } + + public String getConfigBody() { + return configBody; + } + + public UUID getRequestID() { + return requestID; + } + + public static PolicyConfigParamsBuilder builder() { + return new PolicyConfigParamsBuilder(); + } + + /** + * Builder class for policy config parameters + */ + public static class PolicyConfigParamsBuilder { + PolicyConfigParams m = new PolicyConfigParams(); + + private PolicyConfigParamsBuilder() { |