/** * Method that will insert a null value * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insertNull(int index) { _insert(index, nullNode()); return this; }
/** * Method that will insert specified numeric value * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, long v) { return _insert(index, numberNode(v)); }
/** * Method that will insert specified numeric value * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, double v) { return _insert(index, numberNode(v)); }
/** * Method that will insert specified String * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, boolean v) { return _insert(index, booleanNode(v)); }
/** * Method that will insert specified numeric value * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, int v) { _insert(index, numberNode(v)); return this; }
/** * Method for creating an array node, inserting it at the * specified point in the array, * and returning the <b>newly created array</b> * (note: NOT 'this' array) */ public ArrayNode insertArray(int index) { ArrayNode n = arrayNode(); _insert(index, n); return n; }
/** * Method that will insert specified numeric value * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, float v) { return _insert(index, numberNode(v)); }
/** * Method for creating an {@link ObjectNode}, appending it at the end * of this array, and returning the <b>newly created node</b> * (note: NOT 'this' array) * * @return Newly constructed ObjectNode */ public ObjectNode insertObject(int index) { ObjectNode n = objectNode(); _insert(index, n); return n; }
/** * Method for inserting specified child node as an element * of this Array. If index is 0 or less, it will be inserted as * the first element; if >= size(), appended at the end, and otherwise * inserted before existing element in specified index. * No exceptions are thrown for any index. * * @return This node (to allow chaining) */ public ArrayNode insert(int index, JsonNode value) { if (value == null) { value = nullNode(); } _insert(index, value); return this; }
/** * Alternative method that we need to avoid bumping into NPE issues * with auto-unboxing. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, Long value) { if (value == null) { return insertNull(index); } return _insert(index, numberNode(value.longValue())); }
/** * Alternative method that we need to avoid bumping into NPE issues * with auto-unboxing. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, Double value) { if (value == null) { return insertNull(index); } return _insert(index, numberNode(value.doubleValue())); }
/** * Alternative method that we need to avoid bumping into NPE issues * with auto-unboxing. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, Boolean value) { if (value == null) { return insertNull(index); } return _insert(index, booleanNode(value.booleanValue())); }
/** * Alternative method that we need to avoid bumping into NPE issues * with auto-unboxing. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, Float value) { if (value == null) { return insertNull(index); } return _insert(index, numberNode(value.floatValue())); }
/** * Alternative method that we need to avoid bumping into NPE issues * with auto-unboxing. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, Integer value) { if (value == null) { insertNull(index); } else { _insert(index, numberNode(value.intValue())); } return this; }
/** * Method that will insert specified numeric value * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, BigDecimal v) { if (v == null) { return insertNull(index); } return _insert(index, numberNode(v)); }
/** * Method that will insert specified String * at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insert(int index, String v) { if (v == null) { return insertNull(index); } return _insert(index, textNode(v)); }
/** * Method that will insert specified binary value * at specified position in this array * (note: when written as JSON, will be Base64 encoded) * * @return This array node, to allow chaining */ public ArrayNode insert(int index, byte[] v) { if (v == null) { return insertNull(index); } return _insert(index, binaryNode(v)); }
/** * Method that will construct a POJONode and * insert it at specified position in this array. * * @return This array node, to allow chaining */ public ArrayNode insertPOJO(int index, Object value) { if (value == null) { return insertNull(index); } return _insert(index, pojoNode(value)); }
/** * Method that will insert specified numeric value * at specified position in this array. * * @return This array node, to allow chaining * * @since 2.9 */ public ArrayNode insert(int index, BigInteger v) { if (v == null) { return insertNull(index); } return _insert(index, numberNode(v)); }
/** * Method for creating an array node, inserting it at the * specified point in the array, * and returning the <b>newly created array</b> * (note: NOT 'this' array) */ public ArrayNode insertArray(int index) { ArrayNode n = arrayNode(); _insert(index, n); return n; }