| 1 | package pl.zankowski.iextrading4j.api.stocks; | |
| 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 BarData implements Serializable { | |
| 13 | ||
| 14 | private static final long serialVersionUID = -1015562442205343716L; | |
| 15 | ||
| 16 | private final String symbol; | |
| 17 | private final LocalDate date; | |
| 18 | private final BigDecimal open; | |
| 19 | private final BigDecimal high; | |
| 20 | private final BigDecimal low; | |
| 21 | private final BigDecimal close; | |
| 22 | private final BigDecimal volume; | |
| 23 | private final BigDecimal unadjustedVolume; | |
| 24 | private final BigDecimal change; | |
| 25 | private final BigDecimal changePercent; | |
| 26 | private final BigDecimal vwap; | |
| 27 | ||
| 28 | @JsonCreator | |
| 29 | public BarData( | |
| 30 | @JsonProperty("symbol") final String symbol, | |
| 31 | @JsonProperty("date") final LocalDate date, | |
| 32 | @JsonProperty("open") final BigDecimal open, | |
| 33 | @JsonProperty("high") final BigDecimal high, | |
| 34 | @JsonProperty("low") final BigDecimal low, | |
| 35 | @JsonProperty("close") final BigDecimal close, | |
| 36 | @JsonProperty("volume") final BigDecimal volume, | |
| 37 | @JsonProperty("unadjustedVolume") final BigDecimal unadjustedVolume, | |
| 38 | @JsonProperty("change") final BigDecimal change, | |
| 39 | @JsonProperty("changePercent") final BigDecimal changePercent, | |
| 40 | @JsonProperty("vwap") final BigDecimal vwap) { | |
| 41 | this.symbol = symbol; | |
| 42 | this.date = date; | |
| 43 | this.open = open; | |
| 44 | this.high = high; | |
| 45 | this.low = low; | |
| 46 | this.close = close; | |
| 47 | this.volume = volume; | |
| 48 | this.unadjustedVolume = unadjustedVolume; | |
| 49 | this.change = change; | |
| 50 | this.changePercent = changePercent; | |
| 51 | this.vwap = vwap; | |
| 52 | } | |
| 53 | ||
| 54 | public String getSymbol() { | |
| 55 |
1
1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/api/stocks/BarData::getSymbol → KILLED |
return symbol; |
| 56 | } | |
| 57 | ||
| 58 | public LocalDate getDate() { | |
| 59 |
1
1. getDate : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getDate → KILLED |
return date; |
| 60 | } | |
| 61 | ||
| 62 | public BigDecimal getOpen() { | |
| 63 |
1
1. getOpen : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getOpen → KILLED |
return open; |
| 64 | } | |
| 65 | ||
| 66 | public BigDecimal getHigh() { | |
| 67 |
1
1. getHigh : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getHigh → KILLED |
return high; |
| 68 | } | |
| 69 | ||
| 70 | public BigDecimal getLow() { | |
| 71 |
1
1. getLow : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getLow → KILLED |
return low; |
| 72 | } | |
| 73 | ||
| 74 | public BigDecimal getClose() { | |
| 75 |
1
1. getClose : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getClose → KILLED |
return close; |
| 76 | } | |
| 77 | ||
| 78 | public BigDecimal getVolume() { | |
| 79 |
1
1. getVolume : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getVolume → KILLED |
return volume; |
| 80 | } | |
| 81 | ||
| 82 | public BigDecimal getUnadjustedVolume() { | |
| 83 |
1
1. getUnadjustedVolume : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getUnadjustedVolume → KILLED |
return unadjustedVolume; |
| 84 | } | |
| 85 | ||
| 86 | public BigDecimal getChange() { | |
| 87 |
1
1. getChange : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getChange → KILLED |
return change; |
| 88 | } | |
| 89 | ||
| 90 | public BigDecimal getChangePercent() { | |
| 91 |
1
1. getChangePercent : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getChangePercent → KILLED |
return changePercent; |
| 92 | } | |
| 93 | ||
| 94 | public BigDecimal getVwap() { | |
| 95 |
1
1. getVwap : replaced return value with null for pl/zankowski/iextrading4j/api/stocks/BarData::getVwap → KILLED |
return vwap; |
| 96 | } | |
| 97 | ||
| 98 | @Override | |
| 99 | public boolean equals(Object o) { | |
| 100 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/stocks/BarData::equals → KILLED |
if (this == o) return true; |
| 101 |
3
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED 3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/stocks/BarData::equals → KILLED |
if (o == null || getClass() != o.getClass()) return false; |
| 102 | BarData barData = (BarData) o; | |
| 103 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/stocks/BarData::equals → KILLED |
return Objects.equal(symbol, barData.symbol) && |
| 104 |
1
1. equals : negated conditional → KILLED |
Objects.equal(date, barData.date) && |
| 105 |
1
1. equals : negated conditional → KILLED |
Objects.equal(open, barData.open) && |
| 106 |
1
1. equals : negated conditional → KILLED |
Objects.equal(high, barData.high) && |
| 107 |
1
1. equals : negated conditional → KILLED |
Objects.equal(low, barData.low) && |
| 108 |
1
1. equals : negated conditional → KILLED |
Objects.equal(close, barData.close) && |
| 109 |
1
1. equals : negated conditional → KILLED |
Objects.equal(volume, barData.volume) && |
| 110 |
1
1. equals : negated conditional → KILLED |
Objects.equal(unadjustedVolume, barData.unadjustedVolume) && |
| 111 |
1
1. equals : negated conditional → KILLED |
Objects.equal(change, barData.change) && |
| 112 |
1
1. equals : negated conditional → KILLED |
Objects.equal(changePercent, barData.changePercent) && |
| 113 |
1
1. equals : negated conditional → KILLED |
Objects.equal(vwap, barData.vwap); |
| 114 | } | |
| 115 | ||
| 116 | @Override | |
| 117 | public int hashCode() { | |
| 118 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/stocks/BarData::hashCode → KILLED |
return Objects.hashCode(symbol, date, open, high, low, close, volume, |
| 119 | unadjustedVolume, change, changePercent, vwap); | |
| 120 | } | |
| 121 | ||
| 122 | @Override | |
| 123 | public String toString() { | |
| 124 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/stocks/BarData::toString → KILLED |
return MoreObjects.toStringHelper(this) |
| 125 | .add("symbol", symbol) | |
| 126 | .add("date", date) | |
| 127 | .add("open", open) | |
| 128 | .add("high", high) | |
| 129 | .add("low", low) | |
| 130 | .add("close", close) | |
| 131 | .add("volume", volume) | |
| 132 | .add("unadjustedVolume", unadjustedVolume) | |
| 133 | .add("change", change) | |
| 134 | .add("changePercent", changePercent) | |
| 135 | .add("vwap", vwap) | |
| 136 | .toString(); | |
| 137 | } | |
| 138 | } | |
Mutations | ||
| 55 |
1.1 |
|
| 59 |
1.1 |
|
| 63 |
1.1 |
|
| 67 |
1.1 |
|
| 71 |
1.1 |
|
| 75 |
1.1 |
|
| 79 |
1.1 |
|
| 83 |
1.1 |
|
| 87 |
1.1 |
|
| 91 |
1.1 |
|
| 95 |
1.1 |
|
| 100 |
1.1 2.2 |
|
| 101 |
1.1 2.2 3.3 |
|
| 103 |
1.1 2.2 |
|
| 104 |
1.1 |
|
| 105 |
1.1 |
|
| 106 |
1.1 |
|
| 107 |
1.1 |
|
| 108 |
1.1 |
|
| 109 |
1.1 |
|
| 110 |
1.1 |
|
| 111 |
1.1 |
|
| 112 |
1.1 |
|
| 113 |
1.1 |
|
| 118 |
1.1 |
|
| 124 |
1.1 |