2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.policy.api;
23 import java.util.UUID;
26 * Policy config parameters representing the request object
28 public class PolicyConfigParams {
29 //policyConfigType the {@link PolicyConfigType} Enum format of the Config Type
30 private PolicyConfigType policyConfigType;
32 //policyName the <code>String</code> format of the Policy Name
33 private String policyName;
35 //policyDescription the <code>String</code> format of the Policy Description
36 private String policyDescription;
38 //onapName the <code>String</code> format of the ONAP Name
39 private String onapName;
41 //configName the <code>String</code> format of the Config Name
42 private String configName;
44 //attributes the <code>Map</code> Attributes that must contain the AttributeType and Map of key,
45 // value pairs corresponding to it.
46 private Map<AttributeType, Map<String, String>> attributes;
48 //configBodyType the {@link PolicyType} Enum format of the config Body Type.
49 private PolicyType configBodyType;
51 //configBody the <code>String</code> format of the Policy Body
52 private String configBody;
54 //requestID unique request ID which will be passed throughout the ONAP components to correlate logging messages.
55 private UUID requestID;
57 private PolicyConfigParams() {
61 PolicyConfigType getPolicyConfigType() {
62 return policyConfigType;
65 public String getPolicyName() {
69 public String getPolicyDescription() {
70 return policyDescription;
73 public String getOnapName() {
77 public String getConfigName() {
81 public Map<AttributeType, Map<String, String>> getAttributes() {
85 PolicyType getConfigBodyType() {
86 return configBodyType;
89 public String getConfigBody() {
93 public UUID getRequestID() {
97 public static PolicyConfigParamsBuilder builder() {
98 return new PolicyConfigParamsBuilder();
102 * Builder class for policy config parameters
104 public static class PolicyConfigParamsBuilder {
105 PolicyConfigParams m = new PolicyConfigParams();
107 private PolicyConfigParamsBuilder() {
111 public PolicyConfigParams build() {
115 public PolicyConfigParamsBuilder policyConfigType(PolicyConfigType policyConfigType) {
116 m.policyConfigType = policyConfigType;
120 public PolicyConfigParamsBuilder policyName(String policyName) {
121 m.policyName = policyName;
125 public PolicyConfigParamsBuilder policyDescription(String policyDescription) {
126 m.policyDescription = policyDescription;
130 public PolicyConfigParamsBuilder onapName(String onapName) {
131 m.onapName = onapName;
135 public PolicyConfigParamsBuilder configName(String configName) {
136 m.configName = configName;
140 public PolicyConfigParamsBuilder attributes(Map<AttributeType, Map<String, String>> attributes) {
141 m.attributes = attributes;
145 public PolicyConfigParamsBuilder configBodyType(PolicyType configBodyType) {
146 m.configBodyType = configBodyType;
150 public PolicyConfigParamsBuilder configBody(String configBody) {
151 m.configBody = configBody;
155 public PolicyConfigParamsBuilder requestID(UUID requestID) {
156 m.requestID = requestID;