public static void appendAbbreviate(final StringBuilder builder, final String str, final int maxWidth) {
        if (str == null) {
            return;
        }
        if (maxWidth < 0) {
            return;
        }
        if (str.length() > maxWidth) {
            builder.append(str, 0, maxWidth);
            appendAbbreviateMessage(builder, str.length());
        } else {
            builder.append(str);
        }
    }
alternative to {@link String#valueOf(Object)}
commons/src/main/java/com/navercorp/pinpoint/common/util/StringUtils.java