Replaced all tabs with spaces in java and pom.xml
[so.git] / common / src / main / java / org / onap / so / serviceinstancebeans / RequestParameters.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
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.onap.so.serviceinstancebeans;
22
23 import java.beans.Transient;
24 import java.io.Serializable;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.Map;
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("payload")
45     private String payload;
46     @JsonProperty("usePreload")
47     private Boolean usePreload; // usePreload would always be true for Update
48
49     @JsonProperty("autoBuildVfModules")
50     private Boolean autoBuildVfModules;
51     @JsonProperty("cascadeDelete")
52     private Boolean cascadeDelete;
53     @JsonProperty("testApi")
54     private String testApi; // usePreload would always be true for Update
55     @JsonProperty("rebuildVolumeGroups")
56     private Boolean rebuildVolumeGroups;
57
58     public String getSubscriptionServiceType() {
59         return subscriptionServiceType;
60     }
61
62     public void setSubscriptionServiceType(String subscriptionServiceType) {
63         this.subscriptionServiceType = subscriptionServiceType;
64     }
65
66     @JsonProperty("aLaCarte")
67     public Boolean getALaCarte() {
68         return aLaCarte;
69     }
70
71     @JsonProperty("aLaCarte")
72     public void setaLaCarte(Boolean aLaCarte) {
73         this.aLaCarte = aLaCarte;
74     }
75
76     public Boolean isaLaCarte() {
77         return aLaCarte;
78     }
79
80     public String getPayload() {
81         return payload;
82     }
83
84     public void setPayload(String value) {
85         this.payload = value;
86     }
87
88     public Boolean isUsePreload() {
89         return usePreload;
90     }
91
92     @JsonProperty("usePreload")
93     public Boolean getUsePreload() {
94         return usePreload;
95     }
96
97     @JsonProperty("usePreload")
98     public void setUsePreload(Boolean usePreload) {
99         this.usePreload = usePreload;
100     }
101
102     public String getTestApi() {
103         return testApi;
104     }
105
106     public void setTestApi(String testApi) {
107         this.testApi = testApi;
108     }
109
110     public List<Map<String, Object>> getUserParams() {
111         return userParams;
112     }
113
114     public void setUserParams(List<Map<String, Object>> userParams) {
115         this.userParams = userParams;
116     }
117
118     public String getUserParamValue(String name) {
119         if (userParams != null) {
120             for (Map<String, Object> param : userParams) {
121                 if (param.containsKey("name") && param.get("name").equals(name) && param.containsKey("value")) {
122                     return param.get("value").toString();
123                 }
124             }
125         }
126         return null;
127     }
128
129     public Boolean getAutoBuildVfModules() {
130         return autoBuildVfModules;
131     }
132
133     public void setAutoBuildVfModules(Boolean autoBuildVfModules) {
134         this.autoBuildVfModules = autoBuildVfModules;
135     }
136
137     public Boolean getCascadeDelete() {
138         return cascadeDelete;
139     }
140
141     public void setCascadeDelete(Boolean cascadeDelete) {
142         this.cascadeDelete = cascadeDelete;
143     }
144
145     public Boolean getRebuildVolumeGroups() {
146         return rebuildVolumeGroups;
147     }
148
149     public void setRebuildVolumeGroups(Boolean rebuildVolumeGroups) {
150         this.rebuildVolumeGroups = rebuildVolumeGroups;
151     }
152
153     @Override
154     public String toString() {
155         return "RequestParameters [subscriptionServiceType=" + subscriptionServiceType + ", userParams=" + userParams
156                 + ", aLaCarte=" + aLaCarte + ", testApi= " + testApi + ", autoBuildVfModules=" + autoBuildVfModules
157                 + ", usePreload=" + usePreload + ", rebuildVolumeGroups=" + rebuildVolumeGroups + ", payload=" + payload
158                 + "]";
159     }
160 }