Skip to content
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

Allow method chaining in Processor.Builder #910

Open
gregorko opened this issue Nov 15, 2024 · 1 comment
Open

Allow method chaining in Processor.Builder #910

gregorko opened this issue Nov 15, 2024 · 1 comment

Comments

@gregorko
Copy link

Description

Return type of methods in Processor.Builder prevent method chaining.

Example:

co.elastic.clients.elasticsearch.ingest.Processor.of(b -> b
    .attachment(a -> a)
    .remove(r -> r)
)

This will not compile since attachment() and all other methods return ObjectBuilder<Processor> instead of Builder

@l-trotta
Copy link
Contributor

Hello! The reason why Processor doesn't allow chaining is that APIs that use it usually require a List<Processor>, so that's how you can set multiple processors. Is there a specific case where you would use multiple processors outside a list? Or could you point me to the API you're trying to use? Maybe there's a case we missed, let me know!

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

No branches or pull requests

2 participants