Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / mso-infrastructure-bpmn / src / main / java / org / onap / so / bpmn / common / adapter / sdnc / SDNCAdapterCallbackRequest.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.onap.so.bpmn.common.adapter.sdnc;
22
23 import java.io.StringWriter;
24 import javax.xml.bind.JAXBContext;
25 import javax.xml.bind.JAXBException;
26 import javax.xml.bind.Marshaller;
27 import javax.xml.bind.annotation.XmlAccessType;
28 import javax.xml.bind.annotation.XmlAccessorType;
29 import javax.xml.bind.annotation.XmlElement;
30 import javax.xml.bind.annotation.XmlRootElement;
31 import javax.xml.bind.annotation.XmlType;
32
33
34 /**
35  * <p>
36  * Java class for anonymous complex type.
37  * 
38  * <p>
39  * The following schema fragment specifies the expected content contained within this class.
40  * 
41  * <pre>
42  * &lt;complexType>
43  *   &lt;complexContent>
44  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
45  *       &lt;sequence>
46  *         &lt;element ref="{http://org.onap/workflow/sdnc/adapter/schema/v1}CallbackHeader"/>
47  *         &lt;element name="RequestData" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/>
48  *       &lt;/sequence>
49  *     &lt;/restriction>
50  *   &lt;/complexContent>
51  * &lt;/complexType>
52  * </pre>
53  * 
54  * 
55  */
56 @XmlAccessorType(XmlAccessType.FIELD)
57 @XmlType(name = "", namespace = "http://org.onap/workflow/sdnc/adapter/schema/v1",
58         propOrder = {"callbackHeader", "requestData"})
59 @XmlRootElement(name = "SDNCAdapterCallbackRequest", namespace = "http://org.onap/workflow/sdnc/adapter/schema/v1")
60 public class SDNCAdapterCallbackRequest {
61
62     @XmlElement(name = "CallbackHeader", required = true, namespace = "http://org.onap/workflow/sdnc/adapter/schema/v1")
63     protected CallbackHeader callbackHeader;
64     @XmlElement(name = "RequestData", required = false, namespace = "http://org.onap/workflow/sdnc/adapter/schema/v1")
65     protected Object requestData;
66
67     /**
68      * Gets the value of the callbackHeader property.
69      * 
70      * @return possible object is {@link CallbackHeader }
71      * 
72      */
73     public CallbackHeader getCallbackHeader() {
74         return callbackHeader;
75     }
76
77     /**
78      * Sets the value of the callbackHeader property.
79      * 
80      * @param value allowed object is {@link CallbackHeader }
81      * 
82      */
83     public void setCallbackHeader(CallbackHeader value) {
84         this.callbackHeader = value;
85     }
86
87     /**
88      * Gets the value of the requestData property.
89      * 
90      * @return possible object is {@link Object }
91      * 
92      */
93     public Object getRequestData() {
94         return requestData;
95     }
96
97     /**
98      * Sets the value of the requestData property.
99      * 
100      * @param value allowed object is {@link Object }
101      * 
102      */
103     public void setRequestData(Object value) {
104         this.requestData = value;
105     }
106
107     @Override
108     public String toString() {
109         StringWriter writer = new StringWriter();
110         try {
111             JAXBContext context = JAXBContext.newInstance(SDNCAdapterCallbackRequest.class);
112             Marshaller m = context.createMarshaller();
113             m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
114             m.marshal(this, writer);
115             return writer.getBuffer().toString();
116         } catch (JAXBException e) {
117             return "";
118         }
119     }
120 }