I have a function which takes in three strings, and any of them or all three might be null (not known in advance). What is the best way to handle this?
The base case is this:
public String doStuff(String a, String b, String c) {
//do stuff
}
If this is called with nulls in any of the strings, I get this error:
-> doStuff("test", null, null)
Unable to execute method public java.lang.String
doStuff(java.lang.String,java.lang.String,java.lang.String)
on object 1c52ac68 of class test with arguments {Wap:java.lang.String, null, null} of size 3
I guess I could overload this for all the possible permutations of nulls in the three inputs, but is there a better way?