I was thinking that perhaps it would be easier to auto-implement these methods if you have the object as a hash, which is your input in this case.
My point was that it is an advantageous start you have there when you are given the object as a hash. So, some things, otherwise tedious, could be auto-implemented. For example, equals() a hash or equals() an object are equivalent but the hash can be cleaner and simpler. Sure objects are hashes eventually but you never know what trickery you will find in there. Same with dumping an object versus dumping a hash.