1 | package pl.zankowski.iextrading4j.client.rest.request.marketdata; | |
2 | ||
3 | import com.google.common.collect.ImmutableMap; | |
4 | import pl.zankowski.iextrading4j.client.rest.request.AbstractRequestFilterBuilder; | |
5 | import pl.zankowski.iextrading4j.client.rest.request.IRestRequestBuilder; | |
6 | ||
7 | import java.util.Arrays; | |
8 | import java.util.HashSet; | |
9 | import java.util.Map; | |
10 | import java.util.Set; | |
11 | ||
12 | import static java.util.stream.Collectors.joining; | |
13 | ||
14 | public abstract class AbstractMarketDataRequestBuilder<R, B extends IRestRequestBuilder> | |
15 | extends AbstractRequestFilterBuilder<R, B> { | |
16 | ||
17 | public static final String ALL_SYMBOLS = "firehose"; | |
18 | ||
19 | private Set<String> symbols = new HashSet<>(); | |
20 | ||
21 | public B withSymbol(String symbol) { | |
22 | this.symbols.add(symbol); | |
23 |
1
1. withSymbol : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/marketdata/AbstractMarketDataRequestBuilder::withSymbol → KILLED |
return (B) this; |
24 | } | |
25 | ||
26 | public B withSymbols(String... symbols) { | |
27 | this.symbols.addAll(Arrays.asList(symbols)); | |
28 |
1
1. withSymbols : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/marketdata/AbstractMarketDataRequestBuilder::withSymbols → KILLED |
return (B) this; |
29 | } | |
30 | ||
31 | public B withAllSymbols() { | |
32 |
1
1. withAllSymbols : removed call to java/util/Set::clear → SURVIVED |
this.symbols.clear(); |
33 | this.symbols.add(ALL_SYMBOLS); | |
34 |
1
1. withAllSymbols : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/marketdata/AbstractMarketDataRequestBuilder::withAllSymbols → KILLED |
return (B) this; |
35 | } | |
36 | ||
37 | protected Map<String, String> getSymbols() { | |
38 |
1
1. getSymbols : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/marketdata/AbstractMarketDataRequestBuilder::getSymbols → KILLED |
return ImmutableMap.<String, String>builder() |
39 | .put("symbols", symbols.stream().collect(joining(","))) | |
40 | .build(); | |
41 | } | |
42 | ||
43 | } | |
Mutations | ||
23 |
1.1 |
|
28 |
1.1 |
|
32 |
1.1 |
|
34 |
1.1 |
|
38 |
1.1 |