We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There is a number of methods in EQL's fluent API that have variable arity.
For example:
T allOfValues(final Object... values);
Often the source of argument values to such methods is a Collection, which results in the following pattern being employed:
Collection
Set<Object> ourValues = ...; ... .allOfValues(ourValues.toArray()) ...
It would be beneficial for programming ergonomics to have such methods accept Collection instances directly.
Fluent API methods are enhanced with additional signatures that accept instances of Collection.
Consider the existence of the following methods in the same class:
// (1) public void accept(Object... values) {} // (2) public void accept(Collection<?> values) {}
Given accept(List.of()), it might at first seem unclear which method is going to be called: both are applicable.
accept(List.of())
According to the JLS, (2) is more specific, thus it is the one that will be called, which is fitting for the use case of this issue.
(2)
The text was updated successfully, but these errors were encountered:
#2210 Make ANTLR Token constructors more liberal in the parameter type
dfa7d0d
#2210 Enhance EQL's fluent API varargs methods with additional signat…
15760b6
…ures accepting Collection
Merge branch 'Issue-#2196' into Issue-#2210
0a813b5
Merge branch 'Issue-#2223' into Issue-#2210
be0f57f
homedirectory
Successfully merging a pull request may close this issue.
Description
There is a number of methods in EQL's fluent API that have variable arity.
For example:
Often the source of argument values to such methods is a
Collection
, which results in thefollowing pattern being employed:
It would be beneficial for programming ergonomics to have such methods accept
Collection
instances directly.Expected outcome
Fluent API methods are enhanced with additional signatures that accept instances of
Collection
.Implementation details
Consider the existence of the following methods in the same class:
Given
accept(List.of())
, it might at first seem unclear which method is going to be called: both are applicable.According to the JLS,
(2)
is more specific, thus it is the one that will be called, which is fitting for the use case of this issue.The text was updated successfully, but these errors were encountered: