Mini Commons
![Maven Central](https://camo.githubusercontent.com/336d260bd7af9765263c56059c2ae95ce3df748183c6cd966a2a2cb17c07ffc1/68747470733a2f2f6d6176656e2d6261646765732e6865726f6b756170702e636f6d2f6d6176656e2d63656e7472616c2f636f6d2e6769746875622e6d6172736368616c6c2f6d696e692d636f6d6d6f6e732f62616467652e737667)
Like Apache Commons Lang but lighter weight.
<dependency>
<groupId>com.github.marschall</groupId>
<artifactId>mini-commons</artifactId>
<version>0.1.0</version>
</dependency>
Changes to Apache Commons Lang:
- Removed reflective
equals
andhashCode
. You generally useequals
andhashCode
for hash based collections, reflection has no place there. - Removed initialOddNumber and multiplierOddNumber from HashCodeBuilder. We have never seen anybody use anything else than the default.
EqualsBuilder#append(Object, Object)
andHashCodeBuilder#append(Object)
are simpler due to removed support for arrays.- If you want array support use
EqualsBuilder#appendDeep(Object, Object)
orHashCodeBuilder#appendDeep(Object)
. Is this the same pattern thatjava.util.Objects
andjava.util.Arrays
use.
- If you want array support use
- Delegate to
java.util.Objects
,java.util.Arrays
,java.lang.Long
,java.lang.Double
where possible.- This may benefit from future optimizations.
- More JDK compliant hashing:
- use 31 instead of 37 as a hash code multiplier
- use JDK hash code for booleans