Demo of Item 10 from EffectiveJava 3/E.
All objects must obey general contract when overriding
AutoValue from Google
saves the programmer from writing custom
hashCode implementations. IDEs can
generate implementations, but they're fragile -- and not future-proof.
AutoValue annotation is a smarter
- all the value objects are immutable.
bakingPowderare required properties, the only way to build a cake is by supplying these properties to Builder.
- AutoValue introduction: https://github.com/google/auto/blob/master/value/userguide/index.md
- AutoValue Builder: https://github.com/google/auto/blob/master/value/userguide/builders.md