类 CustomFunctionExtension
java.lang.Object
net.sohelp.boot.demo.core.magic.script.CustomFunctionExtension
- 所有已实现的接口:
org.ssssssss.script.functions.ExtensionMethod
public class CustomFunctionExtension
extends Object
implements org.ssssssss.script.functions.ExtensionMethod
自定义扩展方法
https://ssssssss.org/guide/custom/extension.html
- 另请参阅:
-
构造器详细资料
-
CustomFunctionExtension
public CustomFunctionExtension()
-
-
方法详细资料
-
support
扩展String方法- 指定者:
support在接口中org.ssssssss.script.functions.ExtensionMethod
-
toInt
@Comment("\u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3aInteger(\u65b9\u6cd5\u540d\u7684\u63d0\u793a)") public Integer toInt(String str) 方法参数至少有一个,且第一个参数必须为support方法返回的类型 以将字符串转为int为例,该方法编写如下,最终调用时使用strVar.toInt()调用 该方法第一个参数会自动被传入,所以调用时无需传入 var str = '123'; //以下两种方式都支持 return '1234'.toInt(); //return str.toInt();
-