@NotNull private static String createInitializers( @NotNull final Type type, @NotNull final List<Expression> initializers) { List<String> arguments = new LinkedList<String>(); for (Expression i : initializers) arguments.add(explicitConvertIfNeeded(type, i)); return AstUtil.join(arguments, COMMA_WITH_SPACE); }
@NotNull private static String createPrimaryConstructorInvocation( @NotNull String s, @NotNull List<? extends Field> fields, @NotNull Map<String, String> initializers) { List<String> result = new LinkedList<String>(); for (Field f : fields) { String id = f.getIdentifier().toKotlin(); result.add(initializers.get(id)); } return s + "(" + AstUtil.join(result, ", ") + ")"; }
@NotNull private static String quoteKeywords(@NotNull String packageName) { List<String> result = new LinkedList<String>(); for (String part : packageName.split("\\.")) result.add(new IdentifierImpl(part).toKotlin()); return AstUtil.join(result, "."); }