What is a short-hand method for creating a of key/value pairs from a class instance variables?
<p>What should be a best way to create key/value pairs for all the string instance variables of a class? Is there any library exists doing such a task? </p>

<p>I am doing the same using a reflection based backward look-up. But it seems doing to much work.</p>

<p>For example:</p>

<p>I have a class</p>

<pre><code>public class Account implements ManagedEntity {

private String accountNumber;

public Account(String accountNumber) {
    this.accountNumber = accountNumber;
}
}
</code></pre>

<p>If an instance of <code>Account</code> class is created like blelow,
    Account ac = new Account("abc");</p>

<p>The output map should be like: [{"accountNumber", "abc"}].</p>
