Skip to content

Overload the linkTypes method to add the var-args approach #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 8, 2025

Conversation

lordofthejars
Copy link
Contributor

@lordofthejars lordofthejars commented Jun 5, 2025

I overloaded the method to avoid users having to directly use the Set static method.

Copy link
Owner

@robinst robinst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. Just a formatting nit.

* @param linkTypes the link types that should be extracted (by default, all types are extracted)
* @return this builder
*/
public Builder linkTypes(LinkType...linkTypes) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting:

Suggested change
public Builder linkTypes(LinkType...linkTypes) {
public Builder linkTypes(LinkType... linkTypes) {

@lordofthejars
Copy link
Contributor Author

Fixed. BTW can I send you a PR making extractLinks (and Spans) return a Java Stream using SupportStream class?

@robinst
Copy link
Owner

robinst commented Jun 8, 2025

BTW can I send you a PR making extractLinks (and Spans) return a Java Stream using SupportStream class?

That would be an API break, unless you'd want to add a pair of new methods (which I wouldn't want).. Maybe just add some documentation, e.g. in the Javadoc:

 * If you want a stream, use StreamSupport.stream(extractor.extractLinks(input).spliterator(), false)

And add an example in the README?

@robinst robinst merged commit 5827f74 into robinst:main Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants