Add `equals`, `hashCode` and `toString` to `Constant`
- Add
toString - Add
equalsandhashCode
Codecov Report
Merging #1616 (f9abb8d) into master (a9c3bdc) will decrease coverage by
0.11%. The diff coverage is77.77%.
@@ Coverage Diff @@
## master #1616 +/- ##
============================================
- Coverage 90.16% 90.05% -0.12%
+ Complexity 1616 1608 -8
============================================
Files 302 298 -4
Lines 3784 3759 -25
Branches 121 122 +1
============================================
- Hits 3412 3385 -27
Misses 339 339
- Partials 33 35 +2
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/main/java/org/cactoos/scalar/Constant.java | 84.61% <77.77%> (-15.39%) |
:arrow_down: |
| src/main/java/org/cactoos/scalar/Solid.java | 90.00% <0.00%> (-10.00%) |
:arrow_down: |
| src/main/java/org/cactoos/iterable/IterableOf.java | 95.83% <0.00%> (-0.17%) |
:arrow_down: |
| src/main/java/org/cactoos/scalar/Sealed.java | ||
| src/main/java/org/cactoos/scalar/SumOfInt.java | ||
| src/main/java/org/cactoos/scalar/SumOfFloat.java | ||
| ...c/main/java/org/cactoos/scalar/NumberEnvelope.java | ||
| src/main/java/org/cactoos/scalar/NumberOf.java | ||
| src/main/java/org/cactoos/scalar/MaxOf.java | ||
| src/main/java/org/cactoos/scalar/SumOfDouble.java | ||
| ... and 17 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update a9c3bdc...f9abb8d. Read the comment docs.
@0crat status
@0crat in
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@andreoss I'm not exactly sure what would justify having Scalar objects implement those methods... I know that Text has such methods implemented and even there I'm not sure it's relevant.
The only places where they make sense to me is for classes used to purely store data, such as collections.
Did you have a particular need in mind for this PR?
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel Constant (as many Scalar implementations) is troublesome to use without calling value().
I expect that two identical constants should be equal at least. toString simplifies logging, as I primarily use Constant as configuration defaults.
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@victornoel/z everybody who has role REV is banned at #1616; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)