/** * A utility method to do multiple appends to a StringBuffer. * If the given object is null the string "null" will be appended. If * non-null then we append to the StringBuffer the results of * sn.toString (); * * @param sb StringBuffer to append to (may be <code>null</code>) * @param s1 first object to append * @param s2 second object to append * @return StringBuffer with appended objects */ public static StringBuffer append(StringBuffer sb, Object s1, Object s2) { sb = append(sb, s1); sb.append((s2 == null) ? "null" : s2.toString()); return sb; }
/** * A utility method to do multiple appends to a StringBuffer. * If the given object is null the string "null" will be appended. If * non-null then we append to the StringBuffer the results of * sn.toString (); * * @param sb StringBuffer to append to (may be <code>null</code>) * @param s1 first object to append * @param s2 second object to append * @param s3 third object to append * @return StringBuffer with appended objects */ public static StringBuffer append(StringBuffer sb, Object s1, Object s2, Object s3) { sb = append(sb, s1, s2); sb.append((s3 == null) ? "null" : s3.toString()); return sb; }
/** * A utility method to do multiple appends to a StringBuffer. * If the given object is null the string "null" will be appended. If * non-null then we append to the StringBuffer the results of * sn.toString (); * * @param sb StringBuffer to append to (may be <code>null</code>) * @param s1 first object to append * @param s2 second object to append * @param s3 third object to append * @param s4 fourth object to append * @return StringBuffer with appended objects */ public static StringBuffer append(StringBuffer sb, Object s1, Object s2, Object s3, Object s4) { sb = append(sb, s1, s2, s3); sb.append((s4 == null) ? "null" : s4.toString()); return sb; }
/** * A utility method to do multiple appends to a StringBuffer. * If the given object is null the string "null" will be appended. If * non-null then we append to the StringBuffer the results of * sn.toString (); * * @param sb StringBuffer to append to (may be <code>null</code>) * @param s1 first object to append * @param s2 second object to append * @param s3 third object to append * @param s4 fourth object to append * @param s5 fifth object to append * @return StringBuffer with appended objects */ public static StringBuffer append(StringBuffer sb, Object s1, Object s2, Object s3, Object s4, Object s5) { sb = append(sb, s1, s2, s3, s4); sb.append((s5 == null) ? "null" : s5.toString()); return sb; }