remove dependency of drool-application/yaml in actors
[policy/models.git] / models-interactions / model-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  * Modifications Copyright (C) 2019 Nordix Foundation.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.controlloop.policy;
23
24 import java.util.Map;
25
26 public class PolicyParam {
27     private String id;
28     private String name;
29     private String description;
30     private String actor;
31     private Map<String, String> payload;
32     private Target target;
33     private String recipe;
34     private Integer retries;
35     private Integer timeout;
36
37     public static PolicyParamBuilder builder() {
38         return  new PolicyParamBuilder();
39     }
40
41     public String getId() {
42         return id;
43     }
44
45     public String getName() {
46         return name;
47     }
48
49     public String getDescription() {
50         return description;
51     }
52
53     public String getActor() {
54         return actor;
55     }
56
57     public Map<String, String> getPayload() {
58         return payload;
59     }
60
61     public Target getTarget() {
62         return target;
63     }
64
65     public String getRecipe() {
66         return recipe;
67     }
68
69     public Integer getRetries() {
70         return retries;
71     }
72
73     public Integer getTimeout() {
74         return timeout;
75     }
76
77     public static class PolicyParamBuilder {
78
79         PolicyParam policyParm = new PolicyParam();
80
81         private PolicyParamBuilder() {
82         }
83
84         public PolicyParam build() {
85             return policyParm;
86         }
87
88         public PolicyParamBuilder id(String id) {
89             policyParm.id = id;
90             return this;
91         }
92
93         public PolicyParamBuilder name(String name) {
94             policyParm.name = name;
95             return this;
96         }
97
98         public PolicyParamBuilder description(String description) {
99             policyParm.description = description;
100             return this;
101         }
102
103         public PolicyParamBuilder actor(String actor) {
104             policyParm.actor = actor;
105             return this;
106         }
107
108         public PolicyParamBuilder payload(Map<String, String> payload) {
109             policyParm.payload = payload;
110             return this;
111         }
112
113         public PolicyParamBuilder target(Target target) {
114             policyParm.target = target;
115             return this;
116         }
117
118         public PolicyParamBuilder recipe(String recipe) {
119             policyParm.recipe = recipe;
120             return this;
121         }
122
123         public PolicyParamBuilder retries(Integer retries) {
124             policyParm.retries = retries;
125             return this;
126         }
127
128         public PolicyParamBuilder timeout(Integer timeout) {
129             policyParm.timeout = timeout;
130             return this;
131         }
132     }
133 }