public class StringUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
GENERAL |
static String |
GENERAL_STR |
static String[] |
PACKAGE_EXT
支持的压缩包格式
|
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
convertFileStr(String text,
String def)
转换 文件内容
|
static String |
delStartPath(File file,
String startPath,
boolean inName)
删除文件开始的路径
|
static String |
formatStrByMap(String command,
Map<String,String> evn)
根据 map 替换 字符串变量
|
static String |
getArgsValue(String[] args,
String name)
获取启动参数
|
static String |
getNextScaleTime(String time,
Long millis)
指定时间的下一个刻度
|
static File |
getToolsJar()
获取jdk 中的tools jar文件路径
|
static <T> T |
jsonConvert(String jsonStr,
Class<T> cls)
json 字符串转 bean,兼容普通json和字符串包裹情况
|
static <T> List<T> |
jsonConvertArray(String jsonStr,
Class<T> cls)
json 字符串转 bean,兼容普通json和字符串包裹情况
|
public static final String GENERAL_STR
public static final Pattern GENERAL
public static final String[] PACKAGE_EXT
public static String getArgsValue(String[] args, String name)
args
- 所有参数name
- 参数名public static String convertFileStr(String text, String def)
text
- 字符串,可能为文件协议地址def
- 默认值public static String delStartPath(File file, String startPath, boolean inName)
file
- 要删除的文件startPath
- 开始的路径inName
- 是否返回文件名public static File getToolsJar()
public static String getNextScaleTime(String time, Long millis)
public static <T> T jsonConvert(String jsonStr, Class<T> cls)
T
- 泛型jsonStr
- json 字符串cls
- 要转为bean的类public static <T> List<T> jsonConvertArray(String jsonStr, Class<T> cls)
T
- 泛型jsonStr
- json 字符串cls
- 要转为bean的类Copyright © 2017–2022. All rights reserved.