of
Creates a new TextElementList containing the given elements.
Return
a new list
Parameters
elements
varargs of elements
Creates a new TextElementList wrapping the given list.
IMPORTANT: This method wraps the list directly without copying. Modifications to the TextElementList will affect the original list. Use copyOf if you need an independent copy.
This method is useful for chaining operations:
List<TextElement> result = TextElementList.of(list.subList(0, 10))
.takeWhile(TextElement::isSpaceOrTab);
Content copied to clipboard
Return
a new TextElementList wrapping the given list
Parameters
elements
the list to wrap (not copied)
Throws
if elements is null