| 1 | package pl.zankowski.iextrading4j.api.account; | |
| 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.util.Map; | |
| 10 | ||
| 11 | import static pl.zankowski.iextrading4j.api.util.MapUtil.immutableMap; | |
| 12 | ||
| 13 | public class Usage implements Serializable { | |
| 14 | ||
| 15 | private static final long serialVersionUID = -4979856478459362719L; | |
| 16 | ||
| 17 | private final Long monthlyUsage; | |
| 18 | private final Long monthlyPayAsYouGo; | |
| 19 | private final Map<String, Long> dailyUsage; | |
| 20 | private final Map<String, Long> tokenUsage; | |
| 21 | private final Map<String, Long> keyUsage; | |
| 22 | ||
| 23 | @JsonCreator | |
| 24 | public Usage( | |
| 25 | @JsonProperty("monthlyUsage") final Long monthlyUsage, | |
| 26 | @JsonProperty("monthlyPayAsYouGo") final Long monthlyPayAsYouGo, | |
| 27 | @JsonProperty("dailyUsage") final Map<String, Long> dailyUsage, | |
| 28 | @JsonProperty("tokenUsage") final Map<String, Long> tokenUsage, | |
| 29 | @JsonProperty("keyUsage") final Map<String, Long> keyUsage) { | |
| 30 | this.monthlyUsage = monthlyUsage; | |
| 31 | this.monthlyPayAsYouGo = monthlyPayAsYouGo; | |
| 32 | this.dailyUsage = immutableMap(dailyUsage); | |
| 33 | this.tokenUsage = immutableMap(tokenUsage); | |
| 34 | this.keyUsage = immutableMap(keyUsage); | |
| 35 | } | |
| 36 | ||
| 37 | public Long getMonthlyUsage() { | |
| 38 |
1
1. getMonthlyUsage : replaced Long return value with 0L for pl/zankowski/iextrading4j/api/account/Usage::getMonthlyUsage → KILLED |
return monthlyUsage; |
| 39 | } | |
| 40 | ||
| 41 | public Long getMonthlyPayAsYouGo() { | |
| 42 |
1
1. getMonthlyPayAsYouGo : replaced Long return value with 0L for pl/zankowski/iextrading4j/api/account/Usage::getMonthlyPayAsYouGo → KILLED |
return monthlyPayAsYouGo; |
| 43 | } | |
| 44 | ||
| 45 | public Map<String, Long> getDailyUsage() { | |
| 46 |
1
1. getDailyUsage : replaced return value with null for pl/zankowski/iextrading4j/api/account/Usage::getDailyUsage → KILLED |
return dailyUsage; |
| 47 | } | |
| 48 | ||
| 49 | public Map<String, Long> getTokenUsage() { | |
| 50 |
1
1. getTokenUsage : replaced return value with null for pl/zankowski/iextrading4j/api/account/Usage::getTokenUsage → KILLED |
return tokenUsage; |
| 51 | } | |
| 52 | ||
| 53 | public Map<String, Long> getKeyUsage() { | |
| 54 |
1
1. getKeyUsage : replaced return value with null for pl/zankowski/iextrading4j/api/account/Usage::getKeyUsage → KILLED |
return keyUsage; |
| 55 | } | |
| 56 | ||
| 57 | @Override | |
| 58 | public boolean equals(final Object o) { | |
| 59 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/account/Usage::equals → KILLED |
if (this == o) return true; |
| 60 |
3
1. equals : negated conditional → KILLED 2. equals : negated conditional → KILLED 3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/account/Usage::equals → KILLED |
if (o == null || getClass() != o.getClass()) return false; |
| 61 | final Usage usage = (Usage) o; | |
| 62 |
2
1. equals : negated conditional → KILLED 2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/account/Usage::equals → KILLED |
return Objects.equal(monthlyUsage, usage.monthlyUsage) && |
| 63 |
1
1. equals : negated conditional → KILLED |
Objects.equal(monthlyPayAsYouGo, usage.monthlyPayAsYouGo) && |
| 64 |
1
1. equals : negated conditional → KILLED |
Objects.equal(dailyUsage, usage.dailyUsage) && |
| 65 |
1
1. equals : negated conditional → KILLED |
Objects.equal(tokenUsage, usage.tokenUsage) && |
| 66 |
1
1. equals : negated conditional → KILLED |
Objects.equal(keyUsage, usage.keyUsage); |
| 67 | } | |
| 68 | ||
| 69 | @Override | |
| 70 | public int hashCode() { | |
| 71 |
1
1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/account/Usage::hashCode → KILLED |
return Objects.hashCode(monthlyUsage, monthlyPayAsYouGo, dailyUsage, tokenUsage, keyUsage); |
| 72 | } | |
| 73 | ||
| 74 | @Override | |
| 75 | public String toString() { | |
| 76 |
1
1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/account/Usage::toString → KILLED |
return MoreObjects.toStringHelper(this) |
| 77 | .add("monthlyUsage", monthlyUsage) | |
| 78 | .add("monthlyPayAsYouGo", monthlyPayAsYouGo) | |
| 79 | .add("dailyUsage", dailyUsage) | |
| 80 | .add("tokenUsage", tokenUsage) | |
| 81 | .add("keyUsage", keyUsage) | |
| 82 | .toString(); | |
| 83 | } | |
| 84 | ||
| 85 | } | |
Mutations | ||
| 38 |
1.1 |
|
| 42 |
1.1 |
|
| 46 |
1.1 |
|
| 50 |
1.1 |
|
| 54 |
1.1 |
|
| 59 |
1.1 2.2 |
|
| 60 |
1.1 2.2 3.3 |
|
| 62 |
1.1 2.2 |
|
| 63 |
1.1 |
|
| 64 |
1.1 |
|
| 65 |
1.1 |
|
| 66 |
1.1 |
|
| 71 |
1.1 |
|
| 76 |
1.1 |