You could use Enums on the API but send a byte over the wire, defining
the constant in the enum.
- The additional fields that the enum subclass holds
Hey
that's one per classloader again :)
- The reference to the instance (8 bytes on 64 bit architectures)
With CompressedOops (enabled by default) it's just 4, and only on the
stack to invoke your better-looking API
Sanne