/** * Inserts the specified string at the specified {@code offset}. If the * specified string is null, then the String {@code "null"} is inserted. * * @param offset * the index to insert at. * @param str * the {@code String} to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. */ public StringBuilder insert(int offset, String str) { insert0(offset, str); return this; }
/** * Inserts the string representation of the specified {@code char[]} at the * specified {@code offset}. The {@code char[]} value is converted to a * String according to the rule defined by {@link String#valueOf(char[])}. * * @param offset * the index to insert at. * @param ch * the {@code char[]} to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(char[]) */ public StringBuilder insert(int offset, char[] ch) { insert0(offset, ch); return this; }
/** * Inserts the string representation of the specified {@code char} value at * the specified {@code offset}. The {@code char} value is converted to a * string according to the rule defined by {@link String#valueOf(char)}. * * @param offset * the index to insert at. * @param c * the {@code char} value to insert. * @return this builder. * @throws IndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(char) */ public StringBuilder insert(int offset, char c) { insert0(offset, c); return this; }
/** * Inserts the string representation of the specified {@code boolean} value * at the specified {@code offset}. The {@code boolean} value is converted * to a string according to the rule defined by * {@link String#valueOf(boolean)}. * * @param offset * the index to insert at. * @param b * the {@code boolean} value to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length}. * @see String#valueOf(boolean) */ public StringBuilder insert(int offset, boolean b) { insert0(offset, b ? "true" : "false"); return this; }
/** * Inserts the string representation of the specified subsequence of the * {@code char[]} at the specified {@code offset}. The {@code char[]} value * is converted to a String according to the rule defined by * {@link String#valueOf(char[],int,int)}. * * @param offset * the index to insert at. * @param str * the {@code char[]} to insert. * @param strOffset * the inclusive index. * @param strLen * the number of characters. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}, or {@code strOffset} and {@code strLen} do * not specify a valid subsequence. * @see String#valueOf(char[],int,int) */ public StringBuilder insert(int offset, char[] str, int strOffset, int strLen) { insert0(offset, str, strOffset, strLen); return this; }
/** * Inserts the string representation of the specified subsequence of the * {@code CharSequence} at the specified {@code offset}. The {@code * CharSequence} is converted to a String as defined by * {@link CharSequence#subSequence(int, int)}. If the {@code CharSequence} * is {@code null}, then the string {@code "null"} is used to determine the * subsequence. * * @param offset * the index to insert at. * @param s * the {@code CharSequence} to insert. * @param start * the start of the subsequence of the character sequence. * @param end * the end of the subsequence of the character sequence. * @return this builder. * @throws IndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}, or {@code start} and {@code end} do not * specify a valid subsequence. * @see CharSequence#subSequence(int, int) */ public StringBuilder insert(int offset, CharSequence s, int start, int end) { insert0(offset, s, start, end); return this; }
/** * Inserts the string representation of the specified {@code float} value at * the specified {@code offset}. The {@code float} value is converted to a * string according to the rule defined by {@link String#valueOf(float)}. * * @param offset * the index to insert at. * @param f * the {@code float} value to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(float) */ public StringBuilder insert(int offset, float f) { insert0(offset, Float.toString(f)); return this; }
/** * Inserts the string representation of the specified {@code Object} at the * specified {@code offset}. The {@code Object} value is converted to a * String according to the rule defined by {@link String#valueOf(Object)}. * * @param offset * the index to insert at. * @param obj * the {@code Object} to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(Object) */ public StringBuilder insert(int offset, Object obj) { insert0(offset, obj == null ? "null" : obj.toString()); return this; }
/** * Inserts the string representation of the specified {@code int} value at * the specified {@code offset}. The {@code int} value is converted to a * String according to the rule defined by {@link String#valueOf(int)}. * * @param offset * the index to insert at. * @param i * the {@code int} value to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(int) */ public StringBuilder insert(int offset, int i) { insert0(offset, Integer.toString(i)); return this; }
/** * Inserts the string representation of the specified {@code double} value * at the specified {@code offset}. The {@code double} value is converted * to a String according to the rule defined by * {@link String#valueOf(double)}. * * @param offset * the index to insert at. * @param d * the {@code double} value to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(double) */ public StringBuilder insert(int offset, double d) { insert0(offset, Double.toString(d)); return this; }
/** * Inserts the string representation of the specified {@code long} value at * the specified {@code offset}. The {@code long} value is converted to a * String according to the rule defined by {@link String#valueOf(long)}. * * @param offset * the index to insert at. * @param l * the {@code long} value to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {code length()}. * @see String#valueOf(long) */ public StringBuilder insert(int offset, long l) { insert0(offset, Long.toString(l)); return this; }
/** * Inserts the string representation of the specified {@code CharSequence} * at the specified {@code offset}. The {@code CharSequence} is converted * to a String as defined by {@link CharSequence#toString()}. If {@code s} * is {@code null}, then the String {@code "null"} is inserted. * * @param offset * the index to insert at. * @param s * the {@code CharSequence} to insert. * @return this builder. * @throws IndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see CharSequence#toString() */ public StringBuilder insert(int offset, CharSequence s) { insert0(offset, s == null ? "null" : s.toString()); return this; }
/** * Inserts the specified string at the specified {@code offset}. If the * specified string is null, then the String {@code "null"} is inserted. * * @param offset * the index to insert at. * @param str * the {@code String} to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. */ public StringBuilder insert(int offset, String str) { insert0(offset, str); return this; }
/** * Inserts the specified string at the specified {@code offset}. If the * specified string is null, then the String {@code "null"} is inserted. * * @param offset * the index to insert at. * @param str * the {@code String} to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. */ public StringBuilder insert(int offset, String str) { insert0(offset, str); return this; }
/** * Inserts the string representation of the specified {@code char} value at * the specified {@code offset}. The {@code char} value is converted to a * string according to the rule defined by {@link String#valueOf(char)}. * * @param offset * the index to insert at. * @param c * the {@code char} value to insert. * @return this builder. * @throws IndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(char) */ public StringBuilder insert(int offset, char c) { insert0(offset, c); return this; }
/** * Inserts the string representation of the specified {@code Object} at the * specified {@code offset}. The {@code Object} value is converted to a * String according to the rule defined by {@link String#valueOf(Object)}. * * @param offset * the index to insert at. * @param obj * the {@code Object} to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(Object) */ public StringBuilder insert(int offset, Object obj) { insert0(offset, obj == null ? "null" : obj.toString()); return this; }
/** * Inserts the string representation of the specified {@code double} value * at the specified {@code offset}. The {@code double} value is converted * to a String according to the rule defined by * {@link String#valueOf(double)}. * * @param offset * the index to insert at. * @param d * the {@code double} value to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(double) */ public StringBuilder insert(int offset, double d) { insert0(offset, Double.toString(d)); return this; }
/** * Inserts the string representation of the specified {@code float} value at * the specified {@code offset}. The {@code float} value is converted to a * string according to the rule defined by {@link String#valueOf(float)}. * * @param offset * the index to insert at. * @param f * the {@code float} value to insert. * @return this builder. * @throws StringIndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see String#valueOf(float) */ public StringBuilder insert(int offset, float f) { insert0(offset, Float.toString(f)); return this; }
/** * Inserts the string representation of the specified {@code CharSequence} * at the specified {@code offset}. The {@code CharSequence} is converted * to a String as defined by {@link CharSequence#toString()}. If {@code s} * is {@code null}, then the String {@code "null"} is inserted. * * @param offset * the index to insert at. * @param s * the {@code CharSequence} to insert. * @return this builder. * @throws IndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see CharSequence#toString() */ public StringBuilder insert(int offset, CharSequence s) { insert0(offset, s == null ? "null" : s.toString()); return this; }
/** * Inserts the string representation of the specified {@code CharSequence} * at the specified {@code offset}. The {@code CharSequence} is converted * to a String as defined by {@link CharSequence#toString()}. If {@code s} * is {@code null}, then the String {@code "null"} is inserted. * * @param offset * the index to insert at. * @param s * the {@code CharSequence} to insert. * @return this builder. * @throws IndexOutOfBoundsException * if {@code offset} is negative or greater than the current * {@code length()}. * @see CharSequence#toString() */ public StringBuilder insert(int offset, CharSequence s) { insert0(offset, s == null ? "null" : s.toString()); return this; }