Add UUID function #287

This commit is contained in:
Francis Dong
2021-08-27 18:31:33 +08:00
committed by dxfeng10
parent 7ec6d7056a
commit af30765f2b

View File

@@ -16,6 +16,8 @@
*/ */
package we.fizz.function; package we.fizz.function;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -59,6 +61,7 @@ public class StringFunc implements IFunc {
FuncExecutor.register(NAME_SPACE_PREFIX + "string.endsWith", this); FuncExecutor.register(NAME_SPACE_PREFIX + "string.endsWith", this);
FuncExecutor.register(NAME_SPACE_PREFIX + "string.toUpperCase", this); FuncExecutor.register(NAME_SPACE_PREFIX + "string.toUpperCase", this);
FuncExecutor.register(NAME_SPACE_PREFIX + "string.toLowerCase", this); FuncExecutor.register(NAME_SPACE_PREFIX + "string.toLowerCase", this);
FuncExecutor.register(NAME_SPACE_PREFIX + "string.uuid", this);
} }
/** /**
@@ -155,4 +158,8 @@ public class StringFunc implements IFunc {
return str.toLowerCase(); return str.toLowerCase();
} }
public String uuid() {
return UUID.randomUUID().toString().replaceAll("-", "");
}
} }