| 1 | package pl.zankowski.iextrading4j.api.stats; | |
| 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 Record implements Serializable { | |
| 13 | ||
| 14 | private static final long serialVersionUID = 5186790921999789534L; | |
| 15 | ||
| 16 | private final BigDecimal recordValue; | |
| 17 | private final LocalDate recordDate; | |
| 18 | private final BigDecimal previousDayValue; | |
| 19 | private final BigDecimal avg30Value; | |
| 20 | ||
| 21 | @JsonCreator | |
| 22 | public Record( | |
| 23 | @JsonProperty("recordValue") final BigDecimal recordValue, | |
| 24 | @JsonProperty("recordDate") final LocalDate recordDate, | |
| 25 | @JsonProperty("previousDayValue") final BigDecimal previousDayValue, | |
| 26 | @JsonProperty("avg30Value") final BigDecimal avg30Value) { | |
| 27 | this.recordValue = recordValue; | |
| 28 | this.recordDate = recordDate; | |
| 29 | this.previousDayValue = previousDayValue; | |
| 30 | this.avg30Value = avg30Value; | |
| 31 | } | |
| 32 | ||
| 33 | public BigDecimal getRecordValue() { | |
| 34 |
1
1. getRecordValue : replaced return value with null for pl/zankowski/iextrading4j/api/stats/Record::getRecordValue → KILLED |
return recordValue; |
| 35 | } | |
| 36 | ||
| 37 | public LocalDate getRecordDate() { | |
| 38 |
1
1. getRecordDate : replaced return value with null for pl/zankowski/iextrading4j/api/stats/Record::getRecordDate → KILLED |
return recordDate; |
| 39 | } | |
| 40 | ||
| 41 | public BigDecimal getPreviousDayValue() { | |
| 42 |
1
1. getPreviousDayValue : replaced return value with null for pl/zankowski/iextrading4j/api/stats/Record::getPreviousDayValue → KILLED |
return previousDayValue; |
| 43 | } | |
| 44 | ||
| 45 | public BigDecimal getAvg30Value() { | |
| 46 |
1
1. getAvg30Value : replaced return value with null for pl/zankowski/iextrading4j/api/stats/Record::getAvg30Value → KILLED |
return avg30Value; |
| 47 | } | |
| 48 | ||
| 49 | @Override | |
| 50 | public boolean equals(Object o) { | |
| 51 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/stats/Record::equals → KILLED |
if (this == o) return true; |
| 52 |
3
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED 3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/stats/Record::equals → KILLED |
if (o == null || getClass() != o.getClass()) return false; |
| 53 | Record record = (Record) o; | |
| 54 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/stats/Record::equals → KILLED |
return Objects.equal(recordValue, record.recordValue) && |
| 55 |
1
1. equals : negated conditional → KILLED |
Objects.equal(recordDate, record.recordDate) && |
| 56 |
1
1. equals : negated conditional → KILLED |
Objects.equal(previousDayValue, record.previousDayValue) && |
| 57 |
1
1. equals : negated conditional → KILLED |
Objects.equal(avg30Value, record.avg30Value); |
| 58 | } | |
| 59 | ||
| 60 | @Override | |
| 61 | public int hashCode() { | |
| 62 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/stats/Record::hashCode → KILLED |
return Objects.hashCode(recordValue, recordDate, previousDayValue, avg30Value); |
| 63 | } | |
| 64 | ||
| 65 | @Override | |
| 66 | public String toString() { | |
| 67 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/stats/Record::toString → KILLED |
return MoreObjects.toStringHelper(this) |
| 68 | .add("recordValue", recordValue) | |
| 69 | .add("recordDate", recordDate) | |
| 70 | .add("previousDayValue", previousDayValue) | |
| 71 | .add("avg30Value", avg30Value) | |
| 72 | .toString(); | |
| 73 | } | |
| 74 | } | |
Mutations | ||
| 34 |
1.1 |
|
| 38 |
1.1 |
|
| 42 |
1.1 |
|
| 46 |
1.1 |
|
| 51 |
1.1 2.2 |
|
| 52 |
1.1 2.2 3.3 |
|
| 54 |
1.1 2.2 |
|
| 55 |
1.1 |
|
| 56 |
1.1 |
|
| 57 |
1.1 |
|
| 62 |
1.1 |
|
| 67 |
1.1 |