DCAE-D be initial commit
[sdc/dcae-d/dt-be-main.git] / dcaedt_catalog / asdc / src / main / java / org / onap / sdc / dcae / errormng / ResponseFormat.java
1 package org.onap.sdc.dcae.errormng;
2
3 import com.fasterxml.jackson.annotation.JsonIgnore;
4 import com.fasterxml.jackson.annotation.JsonInclude;
5
6 import java.util.List;
7
8 @JsonInclude(JsonInclude.Include.NON_NULL)
9 public class ResponseFormat {
10
11         @JsonIgnore
12         private int status;
13         private RequestError requestError;
14         private String notes = "";
15
16         public String getNotes() {
17                 return notes;
18         }
19
20         void setNotes(String notes) {
21                 this.notes = notes;
22         }
23
24         public ResponseFormat() {
25                 super();
26         }
27
28         public ResponseFormat(int status) {
29                 super();
30                 this.status = status;
31         }
32
33
34         public void setStatus(int status) {
35                 this.status = status;
36         }
37
38         public Integer getStatus() {
39                 return status;
40         }
41
42         public RequestError getRequestError() {
43                 return requestError;
44         }
45
46         public void setRequestError(RequestError requestError) {
47                 this.requestError = requestError;
48         }
49
50         void setPolicyException(PolicyException policyException) {
51                 this.requestError = new RequestError();
52                 requestError.setPolicyException(policyException);
53         }
54
55         void setServiceException(ServiceException serviceException) {
56                 this.requestError = new RequestError();
57                 requestError.setServiceException(serviceException);
58         }
59
60         void setOkResponseInfo(OkResponseInfo okResponseInfo) {
61                 this.requestError = new RequestError();
62                 requestError.setOkResponseInfo(okResponseInfo);
63         }
64
65         void setServiceExceptions(List<ServiceException> serviceExceptions) {
66                 this.requestError = new RequestError();
67                 requestError.setServiceExceptions(serviceExceptions);
68         }
69
70         @Override
71         public String toString() {
72                 return "ResponseFormat[" + "status=" + status + ", requestError=" + requestError + ']';
73         }
74
75 }