1 | package pl.zankowski.iextrading4j.client.rest.request.stocks.v1; | |
2 | ||
3 | import com.google.common.collect.Maps; | |
4 | import pl.zankowski.iextrading4j.api.stocks.ChartRange; | |
5 | import pl.zankowski.iextrading4j.api.stocks.v1.TechnicalIndicator; | |
6 | import pl.zankowski.iextrading4j.api.stocks.v1.TechnicalIndicatorType; | |
7 | import pl.zankowski.iextrading4j.client.rest.manager.RestRequest; | |
8 | import pl.zankowski.iextrading4j.client.rest.manager.RestRequestBuilder; | |
9 | import pl.zankowski.iextrading4j.client.rest.request.IEXCloudV1RestRequest; | |
10 | import pl.zankowski.iextrading4j.client.rest.request.stocks.AbstractStocksRequestBuilder; | |
11 | ||
12 | import javax.ws.rs.core.GenericType; | |
13 | import java.math.BigDecimal; | |
14 | import java.util.Map; | |
15 | ||
16 | public class TechnicalIndicatorRequestBuilder extends AbstractStocksRequestBuilder<TechnicalIndicator, | |
17 | TechnicalIndicatorRequestBuilder> implements IEXCloudV1RestRequest<TechnicalIndicator> { | |
18 | ||
19 | private static final String RANGE_PARAM_NAME = "range"; | |
20 | private static final String INPUT_1_NAME = "input1"; | |
21 | private static final String INPUT_2_NAME = "input2"; | |
22 | private static final String INPUT_3_NAME = "input3"; | |
23 | private static final String INPUT_4_NAME = "input4"; | |
24 | private static final String TECHNICAL_INDICATOR_TYPE_NAME = "indicator"; | |
25 | ||
26 | private final Map<String, String> queryParameters = Maps.newHashMap(); | |
27 | private TechnicalIndicatorType indicatorType; | |
28 | ||
29 | public TechnicalIndicatorRequestBuilder withTechnicalIndicatorType(final TechnicalIndicatorType indicatorType) { | |
30 | this.indicatorType = indicatorType; | |
31 |
1
1. withTechnicalIndicatorType : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/v1/TechnicalIndicatorRequestBuilder::withTechnicalIndicatorType → KILLED |
return this; |
32 | } | |
33 | ||
34 | public TechnicalIndicatorRequestBuilder withInput1(final BigDecimal input1) { | |
35 | this.queryParameters.put(INPUT_1_NAME, input1.toPlainString()); | |
36 |
1
1. withInput1 : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/v1/TechnicalIndicatorRequestBuilder::withInput1 → KILLED |
return this; |
37 | } | |
38 | ||
39 | public TechnicalIndicatorRequestBuilder withInput2(final BigDecimal input2) { | |
40 | this.queryParameters.put(INPUT_2_NAME, input2.toPlainString()); | |
41 |
1
1. withInput2 : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/v1/TechnicalIndicatorRequestBuilder::withInput2 → KILLED |
return this; |
42 | } | |
43 | ||
44 | public TechnicalIndicatorRequestBuilder withInput3(final BigDecimal input3) { | |
45 | this.queryParameters.put(INPUT_3_NAME, input3.toPlainString()); | |
46 |
1
1. withInput3 : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/v1/TechnicalIndicatorRequestBuilder::withInput3 → KILLED |
return this; |
47 | } | |
48 | ||
49 | public TechnicalIndicatorRequestBuilder withInput4(final BigDecimal input4) { | |
50 | this.queryParameters.put(INPUT_4_NAME, input4.toPlainString()); | |
51 |
1
1. withInput4 : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/v1/TechnicalIndicatorRequestBuilder::withInput4 → KILLED |
return this; |
52 | } | |
53 | ||
54 | public TechnicalIndicatorRequestBuilder withRange(final ChartRange chartRange) { | |
55 | queryParameters.put(RANGE_PARAM_NAME, chartRange.getCode()); | |
56 |
1
1. withRange : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/v1/TechnicalIndicatorRequestBuilder::withRange → KILLED |
return this; |
57 | } | |
58 | ||
59 | @Override | |
60 | public RestRequest<TechnicalIndicator> build() { | |
61 |
1
1. build : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/stocks/v1/TechnicalIndicatorRequestBuilder::build → KILLED |
return RestRequestBuilder.<TechnicalIndicator>builder() |
62 | .withPath("/stock/{symbol}/indicator/{indicator}") | |
63 | .addPathParam(SYMBOL_PARAM_NAME, getSymbol()) | |
64 | .addPathParam(TECHNICAL_INDICATOR_TYPE_NAME, indicatorType.name().toLowerCase()).get() | |
65 | .withResponse(new GenericType<TechnicalIndicator>() {}) | |
66 | .addQueryParam(queryParameters) | |
67 | .build(); | |
68 | } | |
69 | ||
70 | } | |
Mutations | ||
31 |
1.1 |
|
36 |
1.1 |
|
41 |
1.1 |
|
46 |
1.1 |
|
51 |
1.1 |
|
56 |
1.1 |
|
61 |
1.1 |