title: java copy ONLY non-null modified properties value from one object to another object
body: <p>In my Java application, copy ONLY non-null modified properties value from one object to another object.</p>
  <pre><code>Class Emp{
     private String name;
     private int age;
     private String city;
    // setter object
  }
  </code></pre>
  <p>I have two objects</p>
  <ol>
  <li><p><code>&quot;fromDb&quot;</code> --&gt; with values name=&quot;James&quot;, <em><strong>age=30</strong></em> and city=<em><strong>&quot;Mumbai&quot;</strong></em></p>
  </li>
  <li><p><code>&quot;fromPage&quot;</code> --&gt; with values name=&quot;James&quot;, <em><strong>age=35</strong></em> and city=<em><strong><code>null</code></strong></em></p>
  <p>here &quot;fromPage&quot; has two modified properties value - 1. age 30 to 35 and city Mumbai to null
  here I want to copy <em><strong>non-null</strong></em> values from &quot;fromPage&quot; to &quot;fromDb&quot;
  so on final &quot;fromDb&quot; will be name=&quot;James&quot;, <em><strong>age=35</strong></em> and city=&quot;Mumbai&quot;</p>
  </li>
  </ol>
  <p>apache <code>BeanUtils.copyProperties</code> will copying all properties values.
  Is there any api or better way it can be done, instead of comparing each properties.It is a jabx class, so it is huge.</p>