1 | package pl.zankowski.iextrading4j.client.rest.manager; | |
2 | ||
3 | import com.google.common.base.MoreObjects; | |
4 | import com.google.common.base.Objects; | |
5 | import javax.ws.rs.core.GenericType; | |
6 | ||
7 | import java.util.Map; | |
8 | ||
9 | import static pl.zankowski.iextrading4j.api.util.MapUtil.immutableMap; | |
10 | ||
11 | public class RestRequest<R> { | |
12 | ||
13 | private final GenericType<R> responseType; | |
14 | private final PostEntity requestEntity; | |
15 | private final String path; | |
16 | private final MethodType methodType; | |
17 | private final Map<String, String> headerParams; | |
18 | private final Map<String, String> queryParams; | |
19 | private final Map<String, String> pathParams; | |
20 | private final Boolean useSecretToken; | |
21 | ||
22 | public RestRequest(final GenericType<R> responseType, final PostEntity requestEntity, final String path, | |
23 | final MethodType methodType, final Map<String, String> headerParams, | |
24 | final Map<String, String> queryParams, final Map<String, String> pathParams, | |
25 | final Boolean useSecretToken) { | |
26 | this.responseType = responseType; | |
27 | this.requestEntity = requestEntity; | |
28 | this.path = path; | |
29 | this.methodType = methodType; | |
30 | this.headerParams = immutableMap(headerParams); | |
31 | this.queryParams = immutableMap(queryParams); | |
32 | this.pathParams = immutableMap(pathParams); | |
33 | this.useSecretToken = useSecretToken; | |
34 | } | |
35 | ||
36 | public GenericType<R> getResponseType() { | |
37 |
1
1. getResponseType : replaced return value with null for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getResponseType → KILLED |
return responseType; |
38 | } | |
39 | ||
40 | public PostEntity getRequestEntity() { | |
41 |
1
1. getRequestEntity : replaced return value with null for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getRequestEntity → KILLED |
return requestEntity; |
42 | } | |
43 | ||
44 | public String getPath() { | |
45 |
1
1. getPath : replaced return value with "" for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getPath → KILLED |
return path; |
46 | } | |
47 | ||
48 | public MethodType getMethodType() { | |
49 |
1
1. getMethodType : replaced return value with null for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getMethodType → KILLED |
return methodType; |
50 | } | |
51 | ||
52 | public Map<String, String> getHeaderParams() { | |
53 |
1
1. getHeaderParams : replaced return value with null for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getHeaderParams → KILLED |
return headerParams; |
54 | } | |
55 | ||
56 | public Map<String, String> getQueryParams() { | |
57 |
1
1. getQueryParams : replaced return value with null for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getQueryParams → KILLED |
return queryParams; |
58 | } | |
59 | ||
60 | public Map<String, String> getPathParams() { | |
61 |
1
1. getPathParams : replaced return value with null for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getPathParams → KILLED |
return pathParams; |
62 | } | |
63 | ||
64 | public Boolean getUseSecretToken() { | |
65 |
2
1. getUseSecretToken : replaced Boolean return with True for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getUseSecretToken → SURVIVED 2. getUseSecretToken : replaced Boolean return with False for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::getUseSecretToken → KILLED |
return useSecretToken; |
66 | } | |
67 | ||
68 | @Override | |
69 | public boolean equals(final Object o) { | |
70 |
1
1. equals : negated conditional → KILLED |
if (this == o) { |
71 |
1
1. equals : replaced boolean return with false for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::equals → KILLED |
return true; |
72 | } | |
73 |
2
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED |
if (o == null || getClass() != o.getClass()) { |
74 |
1
1. equals : replaced boolean return with true for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::equals → KILLED |
return false; |
75 | } | |
76 | final RestRequest<?> that = (RestRequest<?>) o; | |
77 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::equals → KILLED |
return Objects.equal(responseType, that.responseType) && |
78 |
1
1. equals : negated conditional → KILLED |
Objects.equal(requestEntity, that.requestEntity) && |
79 |
2
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED |
Objects.equal(path, that.path) && |
80 | methodType == that.methodType && | |
81 |
1
1. equals : negated conditional → KILLED |
Objects.equal(headerParams, that.headerParams) && |
82 |
1
1. equals : negated conditional → KILLED |
Objects.equal(queryParams, that.queryParams) && |
83 |
1
1. equals : negated conditional → KILLED |
Objects.equal(pathParams, that.pathParams) && |
84 |
1
1. equals : negated conditional → KILLED |
Objects.equal(useSecretToken, that.useSecretToken); |
85 | } | |
86 | ||
87 | @Override | |
88 | public int hashCode() { | |
89 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::hashCode → KILLED |
return Objects.hashCode(responseType, requestEntity, path, methodType, |
90 | headerParams, queryParams, pathParams, useSecretToken); | |
91 | } | |
92 | ||
93 | @Override | |
94 | public String toString() { | |
95 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/client/rest/manager/RestRequest::toString → KILLED |
return MoreObjects.toStringHelper(this) |
96 | .add("responseType", responseType) | |
97 | .add("requestEntity", requestEntity) | |
98 | .add("path", path) | |
99 | .add("methodType", methodType) | |
100 | .add("headerParams", headerParams) | |
101 | .add("queryParams", queryParams) | |
102 | .add("pathParams", pathParams) | |
103 | .add("useSecretToken", useSecretToken) | |
104 | .toString(); | |
105 | } | |
106 | ||
107 | } | |
Mutations | ||
37 |
1.1 |
|
41 |
1.1 |
|
45 |
1.1 |
|
49 |
1.1 |
|
53 |
1.1 |
|
57 |
1.1 |
|
61 |
1.1 |
|
65 |
1.1 2.2 |
|
70 |
1.1 |
|
71 |
1.1 |
|
73 |
1.1 2.2 |
|
74 |
1.1 |
|
77 |
1.1 2.2 |
|
78 |
1.1 |
|
79 |
1.1 2.2 |
|
81 |
1.1 |
|
82 |
1.1 |
|
83 |
1.1 |
|
84 |
1.1 |
|
89 |
1.1 |
|
95 |
1.1 |