很简单,稍微改一下:
代码这么写:
xxx.executor("abc").executor(1).executor(true).executor(2).execute();
class 你的类 {
executor(String s) { ...; return new 包装类(s); }
executor(int i) { ...; return new 包装类(i); }
executor(boolean b) { ...; return new 包装类(b); }
}
class 包装类 {
包装类(String s) { ... }
包装类(int i) { ... }
包装类(boolean b) { ... }
executor(String s) { ...; return this; }
executor(int i) { ...; return this; }
executor(boolean b) { ...; this; }
execute() { ... }
}