Let's say that you are setting up a POJO.
What do you define when you setup the class?
Here's my list
- Constructor to create an object with supplied fields (so that I can make fields final and hence immutable)
- toString
- equals
- hashcode
- implements comparable
- get methods (where applicable)
- [Optional] copy constructors for mutable fields - to guarantee immutability of the class
- [Optional] Define interfaces to access fields and methods.
- [Optional] implements Serializable and implement a versioning scheme.
Is this overkill or sound engineering? Anything missing that you would add?