1 | package pl.zankowski.iextrading4j.client.rest.request.stocks; | |
2 | ||
3 | import pl.zankowski.iextrading4j.api.stocks.Quote; | |
4 | import pl.zankowski.iextrading4j.client.rest.manager.RestRequest; | |
5 | import pl.zankowski.iextrading4j.client.rest.manager.RestRequestBuilder; | |
6 | import pl.zankowski.iextrading4j.client.rest.request.IEXCloudV1RestRequest; | |
7 | ||
8 | import javax.ws.rs.core.GenericType; | |
9 | import java.util.List; | |
10 | ||
11 | import static java.util.Objects.requireNonNull; | |
12 | ||
13 | public class CollectionRequestBuilder implements IEXCloudV1RestRequest<List<Quote>> { | |
14 | ||
15 | private CollectionType collectionType; | |
16 | private String collectionName; | |
17 | ||
18 | public CollectionRequestBuilder withCollectionType(final CollectionType collectionType) { | |
19 | this.collectionType = collectionType; | |
20 |
1
1. withCollectionType : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/CollectionRequestBuilder::withCollectionType → KILLED |
return this; |
21 | } | |
22 | ||
23 | public CollectionRequestBuilder withCollectionName(final String collectionName) { | |
24 | this.collectionName = collectionName; | |
25 |
1
1. withCollectionName : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/CollectionRequestBuilder::withCollectionName → KILLED |
return this; |
26 | } | |
27 | ||
28 | @Override | |
29 | public RestRequest<List<Quote>> build() { | |
30 | requireNonNull(collectionType); | |
31 | requireNonNull(collectionName); | |
32 | ||
33 |
1
1. build : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/CollectionRequestBuilder::build → KILLED |
return RestRequestBuilder.<List<Quote>>builder() |
34 | .withPath("/stock/market/collection/{type}") | |
35 | .addPathParam("type", collectionType.name().toLowerCase()).get() | |
36 | .withResponse(new GenericType<List<Quote>>() {}) | |
37 | .addQueryParam("collectionName", collectionName) | |
38 | .build(); | |
39 | } | |
40 | ||
41 | } | |
Mutations | ||
20 |
1.1 |
|
25 |
1.1 |
|
33 |
1.1 |