class JsUtil {

    public static String getJsObjectForFieldsValueWithAltFun(
            final String alternativeFunction, final String... ids) {

        if (StringUtil.isBlank(alternativeFunction)) {
            throw new InvalidValueException(
                    "alternativeFunction cannot be blank");
        }

        final StringBuilder builder = new StringBuilder(38);

        builder.append('{');

        for (final Object id : ids) {

            builder.append(id.toString()).append(':')
                    .append(alternativeFunction).append("('")
                    .append(id.toString()).append("').value,");

        }

        builder.replace(builder.length() - 1, builder.length(), "}");

        return builder.toString();
    }

    private  JsUtil();

}