/** * 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 add a null value at the end of this array node. * * @return This array node, to allow chaining */ public ArrayNode addNull() { _add(nullNode()); return this; }
/** * Method that will set specified field, replacing old value, * if any. * * @param value to set field to; if null, will be converted * to a {@link NullNode} first (to remove field entry, call * {@link #remove} instead) * * @return Old value of the field, if any; null if there was no * old value. */ public JsonNode set(int index, JsonNode value) { if (value == null) { // let's not store 'raw' nulls but nodes value = nullNode(); } if (index < 0 || index >= _children.size()) { throw new IndexOutOfBoundsException("Illegal index "+ index +", array size "+size()); } return _children.set(index, value); }
/** * Method for adding specified node at the end of this array. * * @return This node, to allow chaining */ public ArrayNode add(JsonNode value) { if (value == null) { // let's not store 'raw' nulls but nodes value = nullNode(); } _add(value); return this; }
/** * 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; }
@Override void writeChildValue(String childName, String value) { JsonNode childNode = value == null ? node.nullNode() : node.textNode(value); writeChild(childName, childNode); }
/** * 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 add a null value at the end of this array node. * * @return This array node, to allow chaining */ public ArrayNode addNull() { _add(nullNode()); return this; }
/** * Method that will add a null value at the end of this array node. * * @return This array node, to allow chaining */ public ArrayNode addNull() { _add(nullNode()); return this; }
/** * 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 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 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 add a null value at the end of this array node. * * @return This array node, to allow chaining */ public ArrayNode addNull() { _add(nullNode()); return this; }
/** * Method that will add a null value at the end of this array node. * * @return This array node, to allow chaining */ public ArrayNode addNull() { _add(nullNode()); return this; }
/** * 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 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 add a null value at the end of this array node. * * @return This array node, to allow chaining */ public ArrayNode addNull() { _add(nullNode()); return this; }
/** * Method that will add a null value at the end of this array node. * * @return This array node, to allow chaining */ public ArrayNode addNull() { _add(nullNode()); return this; }
/** * Method for adding specified node at the end of this array. * * @return This node, to allow chaining */ public ArrayNode add(JsonNode value) { if (value == null) { // let's not store 'raw' nulls but nodes value = nullNode(); } _add(value); return this; }
/** * Method for adding specified node at the end of this array. * * @return This node, to allow chaining */ public ArrayNode add(JsonNode value) { if (value == null) { // let's not store 'raw' nulls but nodes value = nullNode(); } _add(value); return this; }