1 | package pl.zankowski.iextrading4j.api.alternative; | |
2 | ||
3 | import com.fasterxml.jackson.annotation.JsonCreator; | |
4 | import com.fasterxml.jackson.annotation.JsonProperty; | |
5 | import com.google.common.base.MoreObjects; | |
6 | import com.google.common.base.Objects; | |
7 | ||
8 | import java.io.Serializable; | |
9 | import java.math.BigDecimal; | |
10 | ||
11 | public class CryptoEvent implements Serializable { | |
12 | ||
13 | private static final long serialVersionUID = 9151409423809814546L; | |
14 | ||
15 | private final String symbol; | |
16 | private final CryptoEventType eventType; | |
17 | private final Long timestamp; | |
18 | private final CryptoEventReason reason; | |
19 | private final BigDecimal price; | |
20 | private final BigDecimal size; | |
21 | private final CryptoSide side; | |
22 | ||
23 | @JsonCreator | |
24 | public CryptoEvent( | |
25 | @JsonProperty("symbol") final String symbol, | |
26 | @JsonProperty("eventType") final CryptoEventType eventType, | |
27 | @JsonProperty("timestamp") final Long timestamp, | |
28 | @JsonProperty("reason") final CryptoEventReason reason, | |
29 | @JsonProperty("price") final BigDecimal price, | |
30 | @JsonProperty("size") final BigDecimal size, | |
31 | @JsonProperty("side") final CryptoSide side) { | |
32 | this.symbol = symbol; | |
33 | this.eventType = eventType; | |
34 | this.timestamp = timestamp; | |
35 | this.reason = reason; | |
36 | this.price = price; | |
37 | this.size = size; | |
38 | this.side = side; | |
39 | } | |
40 | ||
41 | public String getSymbol() { | |
42 |
1
1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::getSymbol → KILLED |
return symbol; |
43 | } | |
44 | ||
45 | public CryptoEventType getEventType() { | |
46 |
1
1. getEventType : replaced return value with null for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::getEventType → KILLED |
return eventType; |
47 | } | |
48 | ||
49 | public Long getTimestamp() { | |
50 |
1
1. getTimestamp : replaced Long return value with 0L for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::getTimestamp → KILLED |
return timestamp; |
51 | } | |
52 | ||
53 | public CryptoEventReason getReason() { | |
54 |
1
1. getReason : replaced return value with null for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::getReason → KILLED |
return reason; |
55 | } | |
56 | ||
57 | public BigDecimal getPrice() { | |
58 |
1
1. getPrice : replaced return value with null for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::getPrice → KILLED |
return price; |
59 | } | |
60 | ||
61 | public BigDecimal getSize() { | |
62 |
1
1. getSize : replaced return value with null for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::getSize → KILLED |
return size; |
63 | } | |
64 | ||
65 | public CryptoSide getSide() { | |
66 |
1
1. getSide : replaced return value with null for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::getSide → KILLED |
return side; |
67 | } | |
68 | ||
69 | @Override | |
70 | public boolean equals(final Object o) { | |
71 |
1
1. equals : negated conditional → KILLED |
if (this == o) { |
72 |
1
1. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::equals → KILLED |
return true; |
73 | } | |
74 |
2
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED |
if (o == null || getClass() != o.getClass()) { |
75 |
1
1. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::equals → KILLED |
return false; |
76 | } | |
77 | final CryptoEvent that = (CryptoEvent) o; | |
78 |
3
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED 3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::equals → KILLED |
return Objects.equal(symbol, that.symbol) && |
79 | eventType == that.eventType && | |
80 |
2
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED |
Objects.equal(timestamp, that.timestamp) && |
81 | reason == that.reason && | |
82 |
1
1. equals : negated conditional → KILLED |
Objects.equal(price, that.price) && |
83 |
2
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED |
Objects.equal(size, that.size) && |
84 | side == that.side; | |
85 | } | |
86 | ||
87 | @Override | |
88 | public int hashCode() { | |
89 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::hashCode → KILLED |
return Objects.hashCode(symbol, eventType, timestamp, reason, price, size, side); |
90 | } | |
91 | ||
92 | @Override | |
93 | public String toString() { | |
94 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoEvent::toString → KILLED |
return MoreObjects.toStringHelper(this) |
95 | .add("symbol", symbol) | |
96 | .add("eventType", eventType) | |
97 | .add("timestamp", timestamp) | |
98 | .add("reason", reason) | |
99 | .add("price", price) | |
100 | .add("size", size) | |
101 | .add("side", side) | |
102 | .toString(); | |
103 | } | |
104 | ||
105 | } | |
Mutations | ||
42 |
1.1 |
|
46 |
1.1 |
|
50 |
1.1 |
|
54 |
1.1 |
|
58 |
1.1 |
|
62 |
1.1 |
|
66 |
1.1 |
|
71 |
1.1 |
|
72 |
1.1 |
|
74 |
1.1 2.2 |
|
75 |
1.1 |
|
78 |
1.1 2.2 3.3 |
|
80 |
1.1 2.2 |
|
82 |
1.1 |
|
83 |
1.1 2.2 |
|
89 |
1.1 |
|
94 |
1.1 |