Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / client / sniro / beans / SniroManagerRequest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Modifications Copyright (c) 2019 Samsung
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.so.client.sniro.beans;
24
25 import java.io.Serializable;
26 import com.fasterxml.jackson.annotation.JsonInclude;
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.annotation.JsonInclude.Include;
29 import com.fasterxml.jackson.databind.ObjectMapper;
30 import com.fasterxml.jackson.databind.ObjectWriter;
31 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory;
33
34
35 public class SniroManagerRequest implements Serializable {
36
37     private static final long serialVersionUID = -1541132882892163132L;
38     private static final Logger logger = LoggerFactory.getLogger(SniroManagerRequest.class);
39
40     @JsonProperty("requestInfo")
41     private RequestInfo requestInformation;
42     @JsonProperty("serviceInfo")
43     private ServiceInfo serviceInformation;
44     @JsonProperty("placementInfo")
45     private PlacementInfo placementInformation;
46     @JsonProperty("licenseInfo")
47     private LicenseInfo licenseInformation;
48
49
50     public RequestInfo getRequestInformation() {
51         return requestInformation;
52     }
53
54     public void setRequestInformation(RequestInfo requestInformation) {
55         this.requestInformation = requestInformation;
56     }
57
58     public ServiceInfo getServiceInformation() {
59         return serviceInformation;
60     }
61
62     public void setServiceInformation(ServiceInfo serviceInformation) {
63         this.serviceInformation = serviceInformation;
64     }
65
66     public PlacementInfo getPlacementInformation() {
67         return placementInformation;
68     }
69
70     public void setPlacementInformation(PlacementInfo placementInformation) {
71         this.placementInformation = placementInformation;
72     }
73
74     public LicenseInfo getLicenseInformation() {
75         return licenseInformation;
76     }
77
78     public void setLicenseInformation(LicenseInfo licenseInformation) {
79         this.licenseInformation = licenseInformation;
80     }
81
82
83     @JsonInclude(Include.NON_NULL)
84     public String toJsonString() {
85         String json = "";
86         ObjectMapper mapper = new ObjectMapper();
87         mapper.setSerializationInclusion(Include.NON_NULL);
88         ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
89         try {
90             json = ow.writeValueAsString(this);
91         } catch (Exception e) {
92             logger.error("Unable to convert SniroManagerRequest to string", e);
93         }
94         return json.replaceAll("\\\\", "");
95     }
96
97
98 }