| 1 | package pl.zankowski.iextrading4j.client.socket.request.marketdata.deep; | |
| 2 | ||
| 3 | import com.fasterxml.jackson.annotation.JsonCreator; | |
| 4 | import com.fasterxml.jackson.annotation.JsonProperty; | |
| 5 | import com.fasterxml.jackson.annotation.JsonSubTypes; | |
| 6 | import com.fasterxml.jackson.annotation.JsonTypeInfo; | |
| 7 | import com.google.common.base.Objects; | |
| 8 | import pl.zankowski.iextrading4j.api.marketdata.Auction; | |
| 9 | import pl.zankowski.iextrading4j.api.marketdata.Book; | |
| 10 | import pl.zankowski.iextrading4j.api.marketdata.DeepResult; | |
| 11 | import pl.zankowski.iextrading4j.api.marketdata.OpHaltStatus; | |
| 12 | import pl.zankowski.iextrading4j.api.marketdata.SecurityEvent; | |
| 13 | import pl.zankowski.iextrading4j.api.marketdata.SsrStatus; | |
| 14 | import pl.zankowski.iextrading4j.api.marketdata.SystemEvent; | |
| 15 | import pl.zankowski.iextrading4j.api.marketdata.Trade; | |
| 16 | import pl.zankowski.iextrading4j.api.marketdata.TradingStatus; | |
| 17 | ||
| 18 | import java.io.Serializable; | |
| 19 | ||
| 20 | public class DeepAsyncResponse<T extends DeepResult> implements Serializable { | |
| 21 | ||
| 22 | private final String symbol; | |
| 23 | private final DeepMessageType messageType; | |
| 24 | ||
| 25 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "messageType", visible = true) | |
| 26 | @JsonSubTypes({ | |
| 27 | @JsonSubTypes.Type(value = Auction.class, name = "auction"), | |
| 28 | @JsonSubTypes.Type(value = Book.class, name = "book"), | |
| 29 | @JsonSubTypes.Type(value = OpHaltStatus.class, name = "ophaltstatus"), | |
| 30 | @JsonSubTypes.Type(value = SecurityEvent.class, name = "securityevent"), | |
| 31 | @JsonSubTypes.Type(value = SsrStatus.class, name = "ssr"), | |
| 32 | @JsonSubTypes.Type(value = SystemEvent.class, name = "systemevent"), | |
| 33 | @JsonSubTypes.Type(value = TradingStatus.class, name = "tradingstatus"), | |
| 34 | @JsonSubTypes.Type(value = Trade.class, name = "trades"), | |
| 35 | @JsonSubTypes.Type(value = Trade.class, name = "tradebreak") | |
| 36 | }) | |
| 37 | private final T data; | |
| 38 | private final Long seq; | |
| 39 | ||
| 40 | @JsonCreator | |
| 41 | public DeepAsyncResponse( | |
| 42 | @JsonProperty("symbol") final String symbol, | |
| 43 | @JsonProperty("messageType") final String messageType, | |
| 44 | @JsonProperty("data") final T data, | |
| 45 | @JsonProperty("seq") final Long seq) { | |
| 46 | this.symbol = symbol; | |
| 47 | this.messageType = DeepMessageType.getMessageType(messageType); | |
| 48 | this.data = data; | |
| 49 | this.seq = seq; | |
| 50 | } | |
| 51 | ||
| 52 | public String getSymbol() { | |
| 53 |
1
1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::getSymbol → KILLED |
return symbol; |
| 54 | } | |
| 55 | ||
| 56 | public DeepMessageType getMessageType() { | |
| 57 |
1
1. getMessageType : replaced return value with null for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::getMessageType → KILLED |
return messageType; |
| 58 | } | |
| 59 | ||
| 60 | public T getData() { | |
| 61 |
1
1. getData : replaced return value with null for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::getData → KILLED |
return data; |
| 62 | } | |
| 63 | ||
| 64 | public Long getSeq() { | |
| 65 |
1
1. getSeq : replaced Long return value with 0L for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::getSeq → KILLED |
return seq; |
| 66 | } | |
| 67 | ||
| 68 | @Override | |
| 69 | public boolean equals(final Object o) { | |
| 70 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with false for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::equals → KILLED |
if (this == o) return true; |
| 71 |
3
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED 3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::equals → KILLED |
if (o == null || getClass() != o.getClass()) return false; |
| 72 | final DeepAsyncResponse<?> that = (DeepAsyncResponse<?>) o; | |
| 73 |
3
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED 3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::equals → KILLED |
return Objects.equal(symbol, that.symbol) && |
| 74 | messageType == that.messageType && | |
| 75 |
1
1. equals : negated conditional → KILLED |
Objects.equal(data, that.data) && |
| 76 |
1
1. equals : negated conditional → KILLED |
Objects.equal(seq, that.seq); |
| 77 | } | |
| 78 | ||
| 79 | @Override | |
| 80 | public int hashCode() { | |
| 81 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::hashCode → KILLED |
return Objects.hashCode(symbol, messageType, data, seq); |
| 82 | } | |
| 83 | ||
| 84 | @Override | |
| 85 | public String toString() { | |
| 86 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/client/socket/request/marketdata/deep/DeepAsyncResponse::toString → KILLED |
return "DeepAsyncResponse{" + |
| 87 | "symbol='" + symbol + '\'' + | |
| 88 | ", messageType=" + messageType + | |
| 89 | ", data=" + data + | |
| 90 | ", seq=" + seq + | |
| 91 | '}'; | |
| 92 | } | |
| 93 | } | |
Mutations | ||
| 53 |
1.1 |
|
| 57 |
1.1 |
|
| 61 |
1.1 |
|
| 65 |
1.1 |
|
| 70 |
1.1 2.2 |
|
| 71 |
1.1 2.2 3.3 |
|
| 73 |
1.1 2.2 3.3 |
|
| 75 |
1.1 |
|
| 76 |
1.1 |
|
| 81 |
1.1 |
|
| 86 |
1.1 |