| 1 | package pl.zankowski.iextrading4j.client.rest.request.refdata.v1; | |
| 2 | ||
| 3 | import com.google.common.base.MoreObjects; | |
| 4 | import com.google.common.base.Objects; | |
| 5 | import com.google.common.collect.Lists; | |
| 6 | import pl.zankowski.iextrading4j.api.refdata.v1.SymbolMapping; | |
| 7 | import pl.zankowski.iextrading4j.client.rest.manager.PostEntity; | |
| 8 | import pl.zankowski.iextrading4j.client.rest.manager.RestRequest; | |
| 9 | import pl.zankowski.iextrading4j.client.rest.manager.RestRequestBuilder; | |
| 10 | import pl.zankowski.iextrading4j.client.rest.request.AbstractRequestFilterBuilder; | |
| 11 | import pl.zankowski.iextrading4j.client.rest.request.IEXCloudV1RestRequest; | |
| 12 | ||
| 13 | import javax.ws.rs.core.GenericType; | |
| 14 | import java.util.List; | |
| 15 | ||
| 16 | import static pl.zankowski.iextrading4j.api.util.ListUtil.immutableList; | |
| 17 | ||
| 18 | public class IsinMapperRequestBuilder extends AbstractRequestFilterBuilder<List<List<SymbolMapping>>, IsinMapperRequestBuilder> | |
| 19 | implements IEXCloudV1RestRequest<List<List<SymbolMapping>>> { | |
| 20 | ||
| 21 | private final List<String> isinList = Lists.newArrayList(); | |
| 22 | ||
| 23 | public IsinMapperRequestBuilder addIsin(final String isin) { | |
| 24 | isinList.add(isin); | |
| 25 |
1
1. addIsin : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder::addIsin → KILLED |
return this; |
| 26 | } | |
| 27 | ||
| 28 | @Override | |
| 29 | public RestRequest<List<List<SymbolMapping>>> build() { | |
| 30 |
1
1. build : replaced return value with null for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder::build → KILLED |
return RestRequestBuilder.<List<List<SymbolMapping>>>builder() |
| 31 | .withPath("/ref-data/isin").post() | |
| 32 | .withRequest(new IsinPostEntity(isinList)) | |
| 33 | .withResponse(new GenericType<List<List<SymbolMapping>>>() { | |
| 34 | }) | |
| 35 | .addQueryParam(getFilterParams()) | |
| 36 | .build(); | |
| 37 | } | |
| 38 | ||
| 39 | static class IsinPostEntity extends PostEntity { | |
| 40 | ||
| 41 | private static final long serialVersionUID = -3553375472577931811L; | |
| 42 | ||
| 43 | private final List<String> isin; | |
| 44 | ||
| 45 | public IsinPostEntity(final List<String> isin) { | |
| 46 | this.isin = immutableList(isin); | |
| 47 | } | |
| 48 | ||
| 49 | public List<String> getIsin() { | |
| 50 |
1
1. getIsin : replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::getIsin → KILLED |
return isin; |
| 51 | } | |
| 52 | ||
| 53 | @Override | |
| 54 | public boolean equals(final Object o) { | |
| 55 |
1
1. equals : negated conditional → NO_COVERAGE |
if (this == o) { |
| 56 |
1
1. equals : replaced boolean return with false for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::equals → NO_COVERAGE |
return true; |
| 57 | } | |
| 58 |
2
1. equals : negated conditional → NO_COVERAGE 2. equals : negated conditional → NO_COVERAGE |
if (o == null || getClass() != o.getClass()) { |
| 59 |
1
1. equals : replaced boolean return with true for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::equals → NO_COVERAGE |
return false; |
| 60 | } | |
| 61 |
1
1. equals : negated conditional → NO_COVERAGE |
if (!super.equals(o)) { |
| 62 |
1
1. equals : replaced boolean return with true for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::equals → NO_COVERAGE |
return false; |
| 63 | } | |
| 64 | final IsinPostEntity that = (IsinPostEntity) o; | |
| 65 |
2
1. equals : replaced boolean return with false for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::equals → NO_COVERAGE 2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::equals → NO_COVERAGE |
return Objects.equal(isin, that.isin); |
| 66 | } | |
| 67 | ||
| 68 | @Override | |
| 69 | public int hashCode() { | |
| 70 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::hashCode → NO_COVERAGE |
return Objects.hashCode(super.hashCode(), isin); |
| 71 | } | |
| 72 | ||
| 73 | @Override | |
| 74 | public String toString() { | |
| 75 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/client/rest/request/refdata/v1/IsinMapperRequestBuilder$IsinPostEntity::toString → NO_COVERAGE |
return MoreObjects.toStringHelper(this) |
| 76 | .add("isin", isin) | |
| 77 | .toString(); | |
| 78 | } | |
| 79 | ||
| 80 | } | |
| 81 | ||
| 82 | } | |
Mutations | ||
| 25 |
1.1 |
|
| 30 |
1.1 |
|
| 50 |
1.1 |
|
| 55 |
1.1 |
|
| 56 |
1.1 |
|
| 58 |
1.1 2.2 |
|
| 59 |
1.1 |
|
| 61 |
1.1 |
|
| 62 |
1.1 |
|
| 65 |
1.1 2.2 |
|
| 70 |
1.1 |
|
| 75 |
1.1 |