Mini Commons
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