user1604294 :
private Set<String> fields = new HashSet<>();
public void fields(String... s){
this.fields.addAll(s);
}
Doesn't compile, saying that:
addAll (java.util.Collection<? extends java.lang.String>) in Set cannot be applied to (java.lang.String[])
is there is a good way to get around this?
siyopao :
I think you can convert your array to a list first. Maybe something like
this.fields.addAll(Arrays.asList(s));