1 | package pl.zankowski.iextrading4j.api.options; | |
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 | import java.time.LocalDate; | |
11 | ||
12 | public class Option implements Serializable { | |
13 | ||
14 | private static final long serialVersionUID = 2983757072405826797L; | |
15 | ||
16 | private final String symbol; | |
17 | private final String id; | |
18 | private final String expirationDate; | |
19 | private final BigDecimal contractSize; | |
20 | private final BigDecimal strikePrice; | |
21 | private final BigDecimal closingPrice; | |
22 | private final String side; | |
23 | private final String type; | |
24 | private final BigDecimal volume; | |
25 | private final BigDecimal openInterest; | |
26 | private final BigDecimal bid; | |
27 | private final BigDecimal ask; | |
28 | private final LocalDate lastUpdated; | |
29 | ||
30 | @JsonCreator | |
31 | public Option( | |
32 | @JsonProperty("symbol") final String symbol, | |
33 | @JsonProperty("id") final String id, | |
34 | @JsonProperty("expirationDate") final String expirationDate, | |
35 | @JsonProperty("contractSize") final BigDecimal contractSize, | |
36 | @JsonProperty("strikePrice") final BigDecimal strikePrice, | |
37 | @JsonProperty("closingPrice") final BigDecimal closingPrice, | |
38 | @JsonProperty("side") final String side, | |
39 | @JsonProperty("type") final String type, | |
40 | @JsonProperty("volume") final BigDecimal volume, | |
41 | @JsonProperty("openInterest") final BigDecimal openInterest, | |
42 | @JsonProperty("bid") final BigDecimal bid, | |
43 | @JsonProperty("ask") final BigDecimal ask, | |
44 | @JsonProperty("lastUpdated") final LocalDate lastUpdated) { | |
45 | this.symbol = symbol; | |
46 | this.id = id; | |
47 | this.expirationDate = expirationDate; | |
48 | this.contractSize = contractSize; | |
49 | this.strikePrice = strikePrice; | |
50 | this.closingPrice = closingPrice; | |
51 | this.side = side; | |
52 | this.type = type; | |
53 | this.volume = volume; | |
54 | this.openInterest = openInterest; | |
55 | this.bid = bid; | |
56 | this.ask = ask; | |
57 | this.lastUpdated = lastUpdated; | |
58 | } | |
59 | ||
60 | public String getSymbol() { | |
61 |
1
1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/api/options/Option::getSymbol → KILLED |
return symbol; |
62 | } | |
63 | ||
64 | public String getId() { | |
65 |
1
1. getId : replaced return value with "" for pl/zankowski/iextrading4j/api/options/Option::getId → KILLED |
return id; |
66 | } | |
67 | ||
68 | public String getExpirationDate() { | |
69 |
1
1. getExpirationDate : replaced return value with "" for pl/zankowski/iextrading4j/api/options/Option::getExpirationDate → KILLED |
return expirationDate; |
70 | } | |
71 | ||
72 | public BigDecimal getContractSize() { | |
73 |
1
1. getContractSize : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getContractSize → KILLED |
return contractSize; |
74 | } | |
75 | ||
76 | public BigDecimal getStrikePrice() { | |
77 |
1
1. getStrikePrice : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getStrikePrice → KILLED |
return strikePrice; |
78 | } | |
79 | ||
80 | public BigDecimal getClosingPrice() { | |
81 |
1
1. getClosingPrice : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getClosingPrice → KILLED |
return closingPrice; |
82 | } | |
83 | ||
84 | public String getSide() { | |
85 |
1
1. getSide : replaced return value with "" for pl/zankowski/iextrading4j/api/options/Option::getSide → KILLED |
return side; |
86 | } | |
87 | ||
88 | public String getType() { | |
89 |
1
1. getType : replaced return value with "" for pl/zankowski/iextrading4j/api/options/Option::getType → KILLED |
return type; |
90 | } | |
91 | ||
92 | public BigDecimal getVolume() { | |
93 |
1
1. getVolume : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getVolume → KILLED |
return volume; |
94 | } | |
95 | ||
96 | public BigDecimal getOpenInterest() { | |
97 |
1
1. getOpenInterest : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getOpenInterest → KILLED |
return openInterest; |
98 | } | |
99 | ||
100 | public BigDecimal getBid() { | |
101 |
1
1. getBid : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getBid → KILLED |
return bid; |
102 | } | |
103 | ||
104 | public BigDecimal getAsk() { | |
105 |
1
1. getAsk : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getAsk → KILLED |
return ask; |
106 | } | |
107 | ||
108 | public LocalDate getLastUpdated() { | |
109 |
1
1. getLastUpdated : replaced return value with null for pl/zankowski/iextrading4j/api/options/Option::getLastUpdated → KILLED |
return lastUpdated; |
110 | } | |
111 | ||
112 | @Override | |
113 | public boolean equals(final Object o) { | |
114 |
1
1. equals : negated conditional → KILLED |
if (this == o) { |
115 |
1
1. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/options/Option::equals → KILLED |
return true; |
116 | } | |
117 |
2
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED |
if (o == null || getClass() != o.getClass()) { |
118 |
1
1. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/options/Option::equals → KILLED |
return false; |
119 | } | |
120 | final Option option = (Option) o; | |
121 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/options/Option::equals → KILLED |
return Objects.equal(symbol, option.symbol) && |
122 |
1
1. equals : negated conditional → KILLED |
Objects.equal(id, option.id) && |
123 |
1
1. equals : negated conditional → KILLED |
Objects.equal(expirationDate, option.expirationDate) && |
124 |
1
1. equals : negated conditional → KILLED |
Objects.equal(contractSize, option.contractSize) && |
125 |
1
1. equals : negated conditional → KILLED |
Objects.equal(strikePrice, option.strikePrice) && |
126 |
1
1. equals : negated conditional → KILLED |
Objects.equal(closingPrice, option.closingPrice) && |
127 |
1
1. equals : negated conditional → KILLED |
Objects.equal(side, option.side) && |
128 |
1
1. equals : negated conditional → KILLED |
Objects.equal(type, option.type) && |
129 |
1
1. equals : negated conditional → KILLED |
Objects.equal(volume, option.volume) && |
130 |
1
1. equals : negated conditional → KILLED |
Objects.equal(openInterest, option.openInterest) && |
131 |
1
1. equals : negated conditional → KILLED |
Objects.equal(bid, option.bid) && |
132 |
1
1. equals : negated conditional → KILLED |
Objects.equal(ask, option.ask) && |
133 |
1
1. equals : negated conditional → KILLED |
Objects.equal(lastUpdated, option.lastUpdated); |
134 | } | |
135 | ||
136 | @Override | |
137 | public int hashCode() { | |
138 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/options/Option::hashCode → KILLED |
return Objects.hashCode(symbol, id, expirationDate, contractSize, strikePrice, closingPrice, |
139 | side, type, volume, openInterest, bid, ask, lastUpdated); | |
140 | } | |
141 | ||
142 | @Override | |
143 | public String toString() { | |
144 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/options/Option::toString → KILLED |
return MoreObjects.toStringHelper(this) |
145 | .add("symbol", symbol) | |
146 | .add("id", id) | |
147 | .add("expirationDate", expirationDate) | |
148 | .add("contractSize", contractSize) | |
149 | .add("strikePrice", strikePrice) | |
150 | .add("closingPrice", closingPrice) | |
151 | .add("side", side) | |
152 | .add("type", type) | |
153 | .add("volume", volume) | |
154 | .add("openInterest", openInterest) | |
155 | .add("bid", bid) | |
156 | .add("ask", ask) | |
157 | .add("lastUpdated", lastUpdated) | |
158 | .toString(); | |
159 | } | |
160 | ||
161 | } | |
Mutations | ||
61 |
1.1 |
|
65 |
1.1 |
|
69 |
1.1 |
|
73 |
1.1 |
|
77 |
1.1 |
|
81 |
1.1 |
|
85 |
1.1 |
|
89 |
1.1 |
|
93 |
1.1 |
|
97 |
1.1 |
|
101 |
1.1 |
|
105 |
1.1 |
|
109 |
1.1 |
|
114 |
1.1 |
|
115 |
1.1 |
|
117 |
1.1 2.2 |
|
118 |
1.1 |
|
121 |
1.1 2.2 |
|
122 |
1.1 |
|
123 |
1.1 |
|
124 |
1.1 |
|
125 |
1.1 |
|
126 |
1.1 |
|
127 |
1.1 |
|
128 |
1.1 |
|
129 |
1.1 |
|
130 |
1.1 |
|
131 |
1.1 |
|
132 |
1.1 |
|
133 |
1.1 |
|
138 |
1.1 |
|
144 |
1.1 |