cactoos icon indicating copy to clipboard operation
cactoos copied to clipboard

Add `equals`, `hashCode` and `toString` to `Constant`

Open andreoss opened this issue 4 years ago • 19 comments

  • Add toString
  • Add equals and hashCode

andreoss avatar May 16 '21 00:05 andreoss

Codecov Report

Merging #1616 (f9abb8d) into master (a9c3bdc) will decrease coverage by 0.11%. The diff coverage is 77.77%.

Impacted file tree graph

@@             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 data Powered by Codecov. Last update a9c3bdc...f9abb8d. Read the comment docs.

codecov-commenter avatar May 16 '21 00:05 codecov-commenter

@0crat status

victornoel avatar Jun 12 '21 14:06 victornoel

@0crat status (here)

@victornoel This is what I know about this job in C63314D6Z, as in §32:

0crat avatar Jun 12 '21 15:06 0crat

@0crat in

victornoel avatar Jun 14 '21 14:06 victornoel

@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)

0crat avatar Jun 14 '21 16:06 0crat

@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 avatar Jun 19 '21 14:06 victornoel

@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)

0crat avatar Jun 19 '21 17:06 0crat

@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.

andreoss avatar Jun 21 '21 13:06 andreoss

@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)

0crat avatar Jun 24 '21 17:06 0crat

@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)

0crat avatar Aug 23 '21 07:08 0crat

@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)

0crat avatar Aug 28 '21 08:08 0crat

@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)

0crat avatar Sep 07 '21 11:09 0crat

@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)

0crat avatar Sep 12 '21 10:09 0crat

@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)

0crat avatar Feb 20 '22 08:02 0crat

@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)

0crat avatar Feb 25 '22 10:02 0crat

@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)

0crat avatar May 20 '22 10:05 0crat

@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)

0crat avatar May 25 '22 20:05 0crat

@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)

0crat avatar Aug 01 '22 08:08 0crat

@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)

0crat avatar Aug 06 '22 09:08 0crat