Improve TURF serializer signature for serializing multiple roots.
Description
The method TurfSerializer.serializeDocument(@Nonnull final OutputStream outputStream, @Nonnull Iterable<?> roots) looks good, except that when you try to serialize a collection such as List<>, it automatically thinks you’re serializing multiple roots and not a single root that is a collection. Improve the serialization signatures—maybe something like serializeDocumentRoots() (“from” or “having” or “with roots” maybe) for all the variations that support passing multiple roots.
Environment
None
Activity
Garret Wilson
September 27, 2022 at 1:53 PM
It’s interesting to note that fundamentally the TURF serializer was made to serialize multiple roots, so the overwhelming majority of methods take multiple roots. Only three methods take a single root—but those seem to be the methods used the most.
The method
TurfSerializer.serializeDocument(@Nonnull final OutputStream outputStream, @Nonnull Iterable<?> roots)
looks good, except that when you try to serialize a collection such asList<>
, it automatically thinks you’re serializing multiple roots and not a single root that is a collection. Improve the serialization signatures—maybe something likeserializeDocumentRoots()
(“from” or “having” or “with roots” maybe) for all the variations that support passing multiple roots.