> rename the segments parameter … to make it clear that each value is a path
Good idea.
I would scrap the varargs bit for paths, but support varargs for segments.
path(String… path) -> path(String… path)
replacePath(String… path) -> replacePath(String path) -or-> root().path(p)
It is a bit simpler (to understand & write correct code) when you don’t have ‘/’s coming from content and varargs simultaneously. I highly doubt it will add any “boilerplate” to code. ub.segment(s1, s2, s3) is available; as is ub.path(p1).path(p2) if necessary.
replaceMatrixParams should get the same sort of modifications as replaceQueryParams (eg change to matrix(String) and query(String)).
James Manger