write returns true if a write occurred.
add equals, hashCode and toString