| 1 | package pl.zankowski.iextrading4j.client.sse.manager; | |
| 2 | ||
| 3 | import com.google.common.collect.Maps; | |
| 4 | ||
| 5 | import javax.ws.rs.core.GenericType; | |
| 6 | import java.util.Map; | |
| 7 | ||
| 8 | public class SseRequestBuilder<R> implements ISseParamRequestBuilder<R>, | |
| 9 | ISsePathRequestBuilder<R>, ISseResponseTypeRequestBuilder<R> { | |
| 10 | ||
| 11 | private GenericType<R> responseType; | |
| 12 | private String path; | |
| 13 | private Map<String, String> headerParams; | |
| 14 | private Map<String, String> pathParams; | |
| 15 | private Map<String, String> queryParams; | |
| 16 | private Boolean useSecretToken = Boolean.FALSE; | |
| 17 | ||
| 18 | protected SseRequestBuilder() { | |
| 19 | this.headerParams = Maps.newHashMap(); | |
| 20 | this.pathParams = Maps.newHashMap(); | |
| 21 | this.queryParams = Maps.newHashMap(); | |
| 22 | } | |
| 23 | ||
| 24 | public static <R> ISsePathRequestBuilder<R> builder() { | |
| 25 |
1
1. builder : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::builder → KILLED |
return new SseRequestBuilder<>(); |
| 26 | } | |
| 27 | ||
| 28 | @Override | |
| 29 | public ISseParamRequestBuilder<R> withResponse(final Class<R> responseType) { | |
| 30 | this.responseType = new GenericType<>(responseType); | |
| 31 |
1
1. withResponse : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::withResponse → NO_COVERAGE |
return this; |
| 32 | } | |
| 33 | ||
| 34 | @Override | |
| 35 | public ISseResponseTypeRequestBuilder<R> addPathParam(final String key, final String value) { | |
| 36 | this.pathParams.put(key, value); | |
| 37 |
1
1. addPathParam : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::addPathParam → KILLED |
return this; |
| 38 | } | |
| 39 | ||
| 40 | @Override | |
| 41 | public ISseParamRequestBuilder<R> withResponse(final GenericType<R> responseType) { | |
| 42 | this.responseType = responseType; | |
| 43 |
1
1. withResponse : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::withResponse → KILLED |
return this; |
| 44 | } | |
| 45 | ||
| 46 | @Override | |
| 47 | public ISseParamRequestBuilder<R> addHeaderParam(final String key, final String value) { | |
| 48 | this.headerParams.put(key, value); | |
| 49 |
1
1. addHeaderParam : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::addHeaderParam → NO_COVERAGE |
return this; |
| 50 | } | |
| 51 | ||
| 52 | @Override | |
| 53 | public ISseParamRequestBuilder<R> addQueryParam(final String key, final String value) { | |
| 54 | this.queryParams.put(key, value); | |
| 55 |
1
1. addQueryParam : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::addQueryParam → KILLED |
return this; |
| 56 | } | |
| 57 | ||
| 58 | @Override | |
| 59 | public ISseParamRequestBuilder<R> addQueryParam(final Map<String, String> queryParams) { | |
| 60 |
1
1. addQueryParam : removed call to java/util/Map::putAll → NO_COVERAGE |
this.queryParams.putAll(queryParams); |
| 61 |
1
1. addQueryParam : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::addQueryParam → NO_COVERAGE |
return this; |
| 62 | } | |
| 63 | ||
| 64 | @Override | |
| 65 | public ISseParamRequestBuilder<R> withSecretToken() { | |
| 66 | this.useSecretToken = true; | |
| 67 |
1
1. withSecretToken : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::withSecretToken → NO_COVERAGE |
return this; |
| 68 | } | |
| 69 | ||
| 70 | @Override | |
| 71 | public ISseResponseTypeRequestBuilder<R> withPath(final String path) { | |
| 72 | this.path = path; | |
| 73 |
1
1. withPath : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::withPath → KILLED |
return this; |
| 74 | } | |
| 75 | ||
| 76 | @Override | |
| 77 | public SseRequest<R> build() { | |
| 78 |
1
1. build : replaced return value with null for pl/zankowski/iextrading4j/client/sse/manager/SseRequestBuilder::build → KILLED |
return new SseRequest<>(this.responseType, this.path, this.headerParams, this.pathParams, this.queryParams, |
| 79 | this.useSecretToken); | |
| 80 | } | |
| 81 | ||
| 82 | } | |
Mutations | ||
| 25 |
1.1 |
|
| 31 |
1.1 |
|
| 37 |
1.1 |
|
| 43 |
1.1 |
|
| 49 |
1.1 |
|
| 55 |
1.1 |
|
| 60 |
1.1 |
|
| 61 |
1.1 |
|
| 67 |
1.1 |
|
| 73 |
1.1 |
|
| 78 |
1.1 |