1 package com.griddynamics.jagger.invoker.v2;
3 import org.springframework.http.HttpHeaders;
4 import org.springframework.http.HttpStatus;
6 import java.io.Serializable;
9 import static java.util.stream.Collectors.toMap;
20 public class JHttpResponse<T>
implements Serializable {
22 private HttpStatus status;
24 private HttpHeaders headers;
29 this.headers = headers;
45 return headers.get(
"Cookie").stream()
46 .map(cookieStr -> cookieStr.split(
"="))
47 .collect(toMap(cookieArr -> cookieArr[0], cookieArr -> cookieArr[1]));
50 public static JHttpResponse
copyOf(JHttpResponse jHttpResponse) {
51 if (jHttpResponse == null)
53 return new JHttpResponse(jHttpResponse.getStatus(), jHttpResponse.getBody(), jHttpResponse.getHeaders());
58 return "JHttpResponse{" +
61 ", headers=" + headers +