title: How to convert a Java object (bean) to key-value pairs (and vice versa)?
body: <p>Say I have a very simple java object that only has some getXXX and setXXX properties.  This object is used only to handle values, basically a record or a type-safe (and performant) map.  I often need to covert this object to key value pairs (either strings or type safe) or convert from key value pairs to this object.</p>
  
  <p>Other than reflection or manually writing code to do this conversion, what is the best way to achieve this?</p>
  
  <p>An example might be sending this object over jms, without using the ObjectMessage type (or converting an incoming message to the right kind of object).</p>