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