sS tok_genRecordTransformable(S name, LPairS fields) { ret "public O transformUsing(IF1 f) { " + (empty(fields) ? "this;" : "ret new " + name + "(" + joinWithComma(map(pairsB(fields), field -> "f.get(" + field + ")")) + ");") + " }\n"; }