Sync Integ to Master
[sdc.git] / common-app-api / src / main / java / org / openecomp / sdc / common / http / client / api / HttpResponse.java
1 package org.openecomp.sdc.common.http.client.api;
2
3 import org.apache.commons.lang3.StringUtils;
4
5 public class HttpResponse<T> {
6     private final T response;
7     private final int statusCode;
8     private final String description;
9
10     public HttpResponse(T response, int statusCode) {
11         this.response = response;
12         this.statusCode = statusCode;
13         this.description = StringUtils.EMPTY;
14     }
15     
16     public HttpResponse(T response, int statusCode, String description) {
17         this.response = response;
18         this.statusCode = statusCode;
19         this.description = description;
20     }
21
22     public T getResponse() {
23         return response;
24     }
25
26     public int getStatusCode() {
27         return statusCode;
28     }
29
30     public String getDescription() {
31         return description;
32     }
33
34     @Override
35     public String toString() {
36         StringBuilder builder = new StringBuilder();
37         builder.append("HttpResponse [response=");
38         builder.append(response);
39         builder.append(", statusCode=");
40         builder.append(statusCode);
41         builder.append(", description=");
42         builder.append(description);
43         builder.append("]");
44         return builder.toString();
45     }
46     
47     
48 }