meilisearch-java
meilisearch-java copied to clipboard
- use varargs instead of string arrays
Pull Request
What does this PR do?
it replaces String[] arguments with varargs (String ... foo). It simplifies method calls and it should be backwards compatible.
NOTE:
This pull requests only changes method signature, additional validation should be added in places where at least one value is needed.
@singlyfy thanks for the PR Can you fix the tests (integration/unit tests)? cf the CI
Also, is this PR breaking for the users? I really ask, I don't necessarily refuse breaking PRs since the library is not stable yet, if it improves the user experience. I'm not a Java developer, that's why I ask.
String[] arguments with varargs (String ... foo)
The change should not be breaking @curquiza I tried this sample:
import java.util.Arrays;
public class MyClass {
public static void main(String args[]) {
opa("opa", "123");
opa(new String[] {"opa","data"});
}
public static void opa(String... arg) {
System.out.println(Arrays.toString(arg));
}
}
and compiled + execute nicely! (java 8)
Thank you @brunoocasali
Still needs @singlyfy to fix the tests and we are good