Preview:
const genDTO = (className, id) => {
  var fields = [
    'package com.voltcash.integrations.opencp.common.dto; ',
    '\n',
    'import com.voltcash.integrations.common.dto.BaseJsonEntity; ',
    'import lombok.Data;',
     '\n',
    '@Data ',
    'public class '+ className +' extends BaseJsonEntity{ ' 
  ];
 var declarations = $('#' + id).parentNode.querySelectorAll('td:first-child strong').forEach(e => fields.push('private String ' + e.innerHTML + ';'));
  
  fields.push('}');
  
  console.log(fields.join('\n'));
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter