Merge "Add debugging of REST call"
[policy/drools-applications.git] / controlloop / common / policy-yaml / src / main / java / org / onap / policy / controlloop / policy / PolicyParam.java
1 /*
2  * ============LICENSE_START=======================================================
3  * policy-endpoints
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.policy.controlloop.policy;
22
23 import java.util.Map;
24
25 public class PolicyParam {
26     private String id;
27     private String name;
28     private String description;
29     private String actor;
30     private Map<String, String> payload;
31     private Target target;
32     private String recipe;
33     private Integer retries;
34     private Integer timeout;
35
36     public static PolicyParamBuilder builder() {
37         return  new PolicyParamBuilder();
38     }
39
40     public String getId() {
41         return id;
42     }
43
44     public String getName() {
45         return name;
46     }
47
48     public String getDescription() {
49         return description;
50     }
51
52     public String getActor() {
53         return actor;
54     }
55
56     public Map<String, String> getPayload() {
57         return payload;
58     }
59
60     public Target getTarget() {
61         return target;
62     }
63
64     public String getRecipe() {
65         return recipe;
66     }
67
68     public Integer getRetries() {
69         return retries;
70     }
71
72     public Integer getTimeout() {
73         return timeout;
74     }
75
76     public static class PolicyParamBuilder {
77
78         PolicyParam policyParm = new PolicyParam();
79
80         private PolicyParamBuilder() {
81         }
82
83         public PolicyParam build() {
84             return policyParm;
85         }
86
87         public PolicyParamBuilder id(String id) {
88             policyParm.id = id;
89             return this;
90         }
91
92         public PolicyParamBuilder name(String name) {
93             policyParm.name = name;
94             return this;
95         }
96
97         public PolicyParamBuilder description(String description) {
98             policyParm.description = description;
99             return this;
100         }
101
102         public PolicyParamBuilder actor(String actor) {
103             policyParm.actor = actor;
104             return this;
105         }
106
107         public PolicyParamBuilder payload(Map<String, String> payload) {
108             policyParm.payload = payload;
109             return this;
110         }
111
112         public PolicyParamBuilder target(Target target) {
113             policyParm.target = target;
114             return this;
115         }
116
117         public PolicyParamBuilder recipe(String recipe) {
118             policyParm.recipe = recipe;
119             return this;
120         }
121
122         public PolicyParamBuilder retries(Integer retries) {
123             policyParm.retries = retries;
124             return this;
125         }
126
127         public PolicyParamBuilder timeout(Integer timeout) {
128             policyParm.timeout = timeout;
129             return this;
130         }
131     }
132 }