You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
830 B
56 lines
830 B
|
7 years ago
|
package cn.redrock.assetmanage.utils;
|
||
|
|
|
||
|
|
import java.util.UUID;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* String Utility Class
|
||
|
|
*/
|
||
|
|
public class StringUtil
|
||
|
|
{
|
||
|
|
|
||
|
|
public static String ENTITY_STR="";
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* check if the string is blank "" and null return true
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
public static boolean isBlank(String str)
|
||
|
|
{
|
||
|
|
boolean flag = false;
|
||
|
|
if (str == null || "".equals(str.trim()))
|
||
|
|
{
|
||
|
|
flag = true;
|
||
|
|
}
|
||
|
|
return flag;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* check if the String is not Blank "" and null return false
|
||
|
|
*
|
||
|
|
* @param str
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public static boolean isNotBlank(String str)
|
||
|
|
{
|
||
|
|
boolean flag = false;
|
||
|
|
if (str != null && !"".equals(str))
|
||
|
|
{
|
||
|
|
flag = true;
|
||
|
|
}
|
||
|
|
return flag;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public static String createSerialNum(String model){
|
||
|
|
String serialNum = "";
|
||
|
|
UUID uuid = UUID.randomUUID();
|
||
|
|
serialNum=model+uuid.toString();
|
||
|
|
return serialNum;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|