编辑代码

#JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
str = "private Long id;
    private String paymentNo;
    private Integer businessType;
    private String approveStatus;
    private String status;
    private Date applicationTime;
    private String bankName;
    private String account;
    private String accountName;
    private Double payableAmount;
    private Double paidAmount;
    private String remark;"
isBuild = true
objName = "dto"        
str.split("\n").map{|line| line.strip}.each do |line|
    next unless line.start_with? "private" 
    column_name = line.split(" ").last.strip.gsub(";","")
    if isBuild
        puts ".#{column_name}()"
    else
        puts "#{objName}.set#{column_name.capitalize}();"
    end
end