I have a method like followed:
public IndexRequest source(XContentType xContentType, Object... source) {
// some process
}
And I kown how to use it:
new IndexRequest().source(XContentType.JSON, "field", "baz", "fox"));
Now, I want to use it like this one:
List<String> list = new ArrayList(3);
list.add("field");
list.add("baz");
list.add("fox");
new IndexRequest().source(XContentType.JSON, list));
And then, I find it has passed the Compiler. But I don't know the function is right to be used...
Can I use Object[] instead of Object...