Package org.tomlj

Interface MutableTomlArray

All Superinterfaces:
TomlArray

public interface MutableTomlArray extends TomlArray
A TomlArray whose values can be edited in place.

Accepts the values MutableTomlTable accepts, converted the same way. A TomlTable or TomlArray stored as a value is stored as a deep copy, so later changes to the original are not seen; the stored copy is edited through the getters that return it. null throws a NullPointerException.

A key or a String value must not contain an unpaired surrogate, an OffsetDateTime's offset must be a whole number of minutes, and a LocalDate, LocalDateTime or OffsetDateTime must have a year between 0 and 9999, since none of these can be written as TOML.

An entry's attached comments are edited through its MutableTomlEntry obtained from entry(int), or through the shortcuts here. An unattached comment is added after the last element with addComment(java.lang.String...) and removed with removeComment(int, org.tomlj.TomlComment.Placement). An entry or a comment can be inserted before or after the entry at an index, or before or after any element of this array's sequence, as TomlArray.elements() returns it, with insertBefore(int, java.lang.Object), insertAfter(int, java.lang.Object), insertCommentBefore(int, java.lang.String...), or insertCommentAfter(int, java.lang.String...).

An array read from [[x]] headers accepts any value; nothing requires its entries to stay tables.

An array is written back out with TomlArray.toToml(), and reformat(TomlWriteOptions.Keep) makes it, and everything nested in it, keep less of its existing structure and format.

Not safe for use from multiple threads without external synchronization.