Hello.
Can you please implement infix methods based on static method call to have Kotlin feature of infix method for any Class, if it is possible.
Here is example i expect to have
@Infix(methodAddTo = List.class)
public static boolean addIfNotExists(List list, String str) {
// list is the actual instance we call method from.
if(!list.contains(str))){
list.add(str);
return true;
}
return false;
}
public static void main (String [] args) {
ArrayList<String> arrayList = new ArrayList<String>();
boolean result1 = arrayList.addIfNotExists("Hello World!");
boolean result2 = arrayList.addIfNotExists("Hello World!");
LinkedList<String> linkedList = new LinkedList<String>();
boolean result3 = linkedList.addIfNotExists("Hello World!");
boolean result4 = linkedList.addIfNotExists("Hello World!");
}