public final class Gj extends Object
| 构造器和说明 |
|---|
Gj() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
contains(String[] t,
String u)
Determines whether an array contains other arrays
|
static Calendar |
dateToCalendar(String str)
text for time change to date
|
static void |
excelExport(javax.servlet.http.HttpServletResponse response,
List<Object[]> list,
String[] headers,
String title,
String info)
Excel export
|
static Date |
getDate(String date)
get java for time
|
static Date |
getDate(String date,
String format)
get custom format java for time
|
static String |
getDateAsString(Date date)
get text for time
|
static String |
getDateAsString(Date date,
String format)
get custom format text for time
|
static String |
md5(String body)
MD5 encryption
|
static <T> boolean |
multiParamHasEmpty(List<T> params)
Check multiple parameters for null
|
static boolean |
paramIsEmpty(Object str)
Checks if a single parameter is null
|
static boolean |
paramIsNotEmpty(Object str)
Check multiple parameters for not null
|
static String |
removeEndSymbol(String str,
String symbol)
remove the end symbol that parameter
|
static String |
removeStartSymbol(String str,
String symbol)
remove the start symbol that parameter
|
static String |
removeSymbol(String str,
String symbol)
remove the symbol that parameter
|
static String |
sha256Hmac(String str,
String secret)
sha256 Hmac加密
|
static String[] |
split(String str,
String symbol)
separated by symbols
|
static String |
toLowerCase(String str)
change to lower case
|
static String |
toUpperCase(String str)
change to upper case
|
static List<String> |
trim(List<String> list)
remove null values for the list
|
static String |
trim(String str)
remove null value for the param
|
static String |
urlAppend(String url,
Map<String,Object> map)
url append , example: http://ip:port?
|
static String |
urlAppend(String url,
org.springframework.util.MultiValueMap<String,String> map)
url拼接
|
public static boolean paramIsEmpty(Object str)
str - parameterpublic static <T> boolean multiParamHasEmpty(List<T> params)
T - parameter typeparams - multiple parameterpublic static boolean paramIsNotEmpty(Object str)
str - parameterpublic static String trim(String str)
str - parampublic static List<String> trim(List<String> list)
list - A list of null values that need to be removedpublic static String toUpperCase(@NonNull String str)
str - parameter that need to change to upper casepublic static String toLowerCase(@NonNull String str)
str - parameter that need to change to lower casepublic static String removeSymbol(String str, @Nullable String symbol)
str - parametersymbol - symbolpublic static String removeStartSymbol(String str, String symbol)
str - parametersymbol - symbolpublic static String removeEndSymbol(String str, String symbol)
str - parametersymbol - symbolpublic static String[] split(String str, String symbol)
str - need to separated parametersymbol - symbolpublic static String md5(@NonNull String body)
body - need to encryptionpublic static String sha256Hmac(String str, String secret)
str - 需要加密的消息secret - 秘钥public static void excelExport(javax.servlet.http.HttpServletResponse response,
List<Object[]> list,
String[] headers,
String title,
@Nullable
String info)
response - responselist - Data that needs to be exportedheaders - excel headerstitle - Excel file nameinfo - Excel introduction, Pass null or "" if you don't need itpublic static boolean contains(String[] t, String u)
t - target arrayu - parampublic static String getDateAsString(Date date)
date - datepublic static String getDateAsString(Date date, String format)
date - dateformat - formatpublic static Date getDate(String date) throws ParseException
date - text for timeParseException - format exceptionpublic static Date getDate(String date, String format) throws ParseException
date - dateformat - formatParseException - format expublic static Calendar dateToCalendar(String str) throws ParseException
str - text for timeParseException - format EXpublic static String urlAppend(String url, org.springframework.util.MultiValueMap<String,String> map)
map - 参数url - 需要拼接的urlCopyright © 2019. All rights reserved.