Package org.tomlj
Interface TomlEntry
- All Superinterfaces:
TomlElement
- All Known Subinterfaces:
MutableTomlEntry,MutableTomlKeyValue,TomlKeyValue
An entry of a table or array: the slot a container indexes, with the value it holds and the comments attached to it.
A table's entries are TomlKeyValues; an array's entries are plain TomlEntrys. The other kind of
element a container's elements() holds is an unattached TomlComment, which is not an entry.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable TomlCommentcomment(TomlComment.Placement placement) The comment attached to this entry at a placement.comments()The comments attached to this entry.value()The value this entry holds.Methods inherited from interface org.tomlj.TomlElement
position
-
Method Details
-
value
TomlValue value()The value this entry holds.- Returns:
- The value.
-
comments
List<TomlComment> comments()The comments attached to this entry.Returns the comments in document order: the run written directly above it, if any, then the comment on its line, if any, so at most two, each with its
TomlComment.placement(). These are the commentsTomlTable.comments(List)returns for a key andTomlArray.comments(int)for an index.- Returns:
- The attached comments, in document order. Unmodifiable.
-
comment
The comment attached to this entry at a placement.- Parameters:
placement-TomlComment.Placement.ABOVEfor the run written directly above this entry, orTomlComment.Placement.AFTERfor the comment on its line.- Returns:
- The comment at that placement, or
nullif this entry has none there. - Throws:
NullPointerException- Ifplacementisnull.IllegalArgumentException- IfplacementisTomlComment.Placement.UNATTACHED, since no entry holds an unattached comment.
-