Merge "Reorder modifiers"
[so.git] / common / src / main / java / org / openecomp / mso / serviceinstancebeans / RequestParameters.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.serviceinstancebeans;
22
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.List;
26 import java.util.Map;
27
28 import com.fasterxml.jackson.annotation.JsonInclude;
29 import com.fasterxml.jackson.annotation.JsonInclude.Include;
30 import com.fasterxml.jackson.annotation.JsonProperty;
31 import com.fasterxml.jackson.annotation.JsonRootName;
32
33 @JsonRootName(value = "requestParameters")
34 @JsonInclude(Include.NON_DEFAULT)
35 public class RequestParameters implements Serializable {
36
37         private static final long serialVersionUID = -5979049912538894930L;
38         @JsonProperty("subscriptionServiceType")
39         private String subscriptionServiceType;
40         @JsonProperty("userParams")
41         private List<Map<String, Object>> userParams = new ArrayList<>();
42         @JsonProperty("aLaCarte")
43         private Boolean aLaCarte;
44         @JsonProperty("autoBuildVfModules")
45         private Boolean autoBuildVfModules;
46         @JsonProperty("cascadeDelete")
47         private Boolean cascadeDelete;
48         @JsonProperty("usePreload")
49         private Boolean usePreload; // usePreload would always be true for Update
50         @JsonProperty("rebuildVolumeGroups")
51         private Boolean rebuildVolumeGroups;
52         @JsonProperty("payload")
53         private String payload;
54         @JsonProperty("controllerType")
55         private String controllerType;
56
57         public String getSubscriptionServiceType() {
58                 return subscriptionServiceType;
59         }
60
61         public void setSubscriptionServiceType(String subscriptionServiceType) {
62                 this.subscriptionServiceType = subscriptionServiceType;
63         }
64
65         public Boolean getALaCarte() {
66                 return aLaCarte;
67         }
68
69         public void setaLaCarte(Boolean aLaCarte) {
70                 this.aLaCarte = aLaCarte;
71         }
72         
73         public Boolean isaLaCarte() {
74                 return aLaCarte;
75         }
76
77         public List<Map<String, Object>> getUserParams() {
78                 return userParams;
79         }
80
81         public void setUserParams(List<Map<String, Object>> userParams) {
82                 this.userParams = userParams;
83         }
84
85         public String getUserParamValue(String name){
86                 if(userParams!=null){
87                         for(Map<String, Object> param:userParams){
88                                 if(param.get("name").equals(name)){
89                                         return param.get("value").toString();
90                                 }
91                         }
92                 }
93                 return null;
94         }
95
96         public Boolean getAutoBuildVfModules() {
97                 return autoBuildVfModules;
98         }
99
100         public void setAutoBuildVfModules(Boolean autoBuildVfModules) {
101                 this.autoBuildVfModules = autoBuildVfModules;
102         }
103
104         public Boolean getCascadeDelete() {
105                 return cascadeDelete;
106         }
107
108         public void setCascadeDelete(Boolean cascadeDelete) {
109                 this.cascadeDelete = cascadeDelete;
110         }
111
112         public Boolean isUsePreload() {
113                 return usePreload;
114         }
115
116         public void setUsePreload(Boolean usePreload) {
117                 this.usePreload = usePreload;
118         }
119         
120         public Boolean rebuildVolumeGroups() {
121                 return rebuildVolumeGroups;
122         }
123
124         public Boolean isRebuildVolumeGroups() {
125                 return rebuildVolumeGroups;
126         }
127         public void setRebuildVolumeGroups(Boolean rebuildVolumeGroups) {
128                 this.rebuildVolumeGroups = rebuildVolumeGroups;
129         }
130         public String getPayload(){
131                 return payload;
132         }
133         public void setPayload(String value){
134                 this.payload = value;
135         }
136         
137         public String getControllerType() {
138                 return controllerType;
139         }
140
141         public void setControllerType(String controllerType) {
142                 this.controllerType = controllerType;
143         }
144
145         @Override
146         public String toString() {
147                 return "RequestParameters [subscriptionServiceType=" + subscriptionServiceType + ", userParams=" + userParams
148                                 + ", aLaCarte=" + aLaCarte + ", autoBuildVfModules=" + autoBuildVfModules + ", cascadeDelete="
149                                 + cascadeDelete + ", usePreload=" + usePreload + ", rebuildVolumeGroups=" + rebuildVolumeGroups
150                                 + ", payload=" + payload + ", controllerType=" + controllerType + "]";
151         }
152 }