Package com.foxinmy.weixin4j.util
Class RandomUtil
- java.lang.Object
-
- com.foxinmy.weixin4j.util.RandomUtil
-
public class RandomUtil extends Object
随机码工具类- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description RandomUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
generateLowerString(int length)
返回一个定长的随机纯大写字母字符串(只包含大小写字母)static String
generateString(int length)
返回一个定长的随机字符串(包含数字和大小写字母)static String
generateStringByLetterCharr(int length)
返回一个定长的随机纯字母字符串(只包含大小写字母)static String
generateStringByNumberChar(int length)
返回一个定长的随机纯数字字符串(只包含数字)static String
generateUpperString(int length)
返回一个定长的随机纯小写字母字符串(只包含大小写字母)static String
getUUID()
随机获取UUID字符串(无中划线)static void
main(String[] args)
-
-
-
Method Detail
-
generateString
public static String generateString(int length)
返回一个定长的随机字符串(包含数字和大小写字母)- Parameters:
length
- 随机数的长度- Returns:
-
generateStringByNumberChar
public static String generateStringByNumberChar(int length)
返回一个定长的随机纯数字字符串(只包含数字)- Parameters:
length
- 随机数的长度- Returns:
-
generateStringByLetterCharr
public static String generateStringByLetterCharr(int length)
返回一个定长的随机纯字母字符串(只包含大小写字母)- Parameters:
length
- 随机数的长度- Returns:
-
generateLowerString
public static String generateLowerString(int length)
返回一个定长的随机纯大写字母字符串(只包含大小写字母)- Parameters:
length
- 随机数的长度- Returns:
-
generateUpperString
public static String generateUpperString(int length)
返回一个定长的随机纯小写字母字符串(只包含大小写字母)- Parameters:
length
- 随机数的长度- Returns:
-
getUUID
public static String getUUID()
随机获取UUID字符串(无中划线)- Returns:
- UUID字符串
-
main
public static void main(String[] args)
-
-