Add UUID function #287
This commit is contained in:
@@ -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("-", "");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user