Merge from ecomp 718fd196 - Ext. Services Simulator
[vid.git] / vid-ext-services-simulator / src / main / java / org / onap / simulator / model / SimulatorResponse.java
1 package org.onap.simulator.model;
2
3 import com.fasterxml.jackson.annotation.JsonInclude;
4 import com.fasterxml.jackson.databind.JsonNode;
5
6 import java.util.Map;
7
8 public class SimulatorResponse {
9     private int responseCode;
10     private Map<String, String> responseHeaders;
11
12     @JsonInclude(JsonInclude.Include.NON_NULL)
13     private String body;
14
15     @JsonInclude(JsonInclude.Include.NON_NULL)
16     private String file;
17
18     public int getResponseCode() {
19         return responseCode;
20     }
21
22     public void setResponseCode(int responseCode) {
23         this.responseCode = responseCode;
24     }
25
26     public String getBody() {
27         return body;
28     }
29
30     public void setBody(JsonNode body) {
31         this.body = body.isTextual() ? body.textValue() : body.toString();
32     }
33
34     public Map<String, String> getResponseHeaders() {
35         return responseHeaders;
36     }
37
38     public void setResponseHeaders(Map<String, String> responseHeaders) {
39         this.responseHeaders = responseHeaders;
40     }
41
42     public String getFile() {
43         return file;
44     }
45
46     public void setFile(String file) {
47         this.file = file;
48     }
49
50     @Override
51     public String toString() {
52         return "SimulatorResponse{" +
53                 "responseCode=" + responseCode +
54                 ", body='" + body + '\'' +
55                 ", file='" + file + '\'' +
56                 ", responseHeaders='" + responseHeaders + '\'' +
57                 '}';
58     }
59 }