public class XUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static ExecutorService |
commonPool |
| 构造器和说明 |
|---|
XUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
bindTo(Function<String,String> source,
Object target)
将 source:((k)->v) 数据,绑定到 target:bean
|
static void |
bindTo(Map<String,String> source,
Object target)
将 source:Map 数据,绑定到 target:bean
|
static void |
bindTo(Properties source,
Object target)
将 source:Properties 数据,绑定到 target:bean
|
static String |
buildExt(String extend,
boolean autoMake)
构建应用扩展目录
|
static Properties |
buildProperties(String txt)
根据txt加载配置集
|
static <T> T |
firstOrNull(List<T> list)
获取第一项或者null
|
static String |
getFullStackTrace(Throwable ex)
获取异常的完整内容
|
static URL |
getResource(String name)
获取资源URL
|
static String |
getResourceAsString(String name,
String charset)
获取资源并转为String
|
static Enumeration<URL> |
getResources(String name)
获取资源URL集
|
static String |
getString(InputStream ins,
String charset) |
static String |
guid()
生成UGID
|
static <T> T |
injectProperties(T bean,
Properties propS) |
static boolean |
isBlank(String s)
检查字符串是否为空白
|
static boolean |
isEmpty(String s)
检查字符串是否为空
|
static boolean |
isNotEmpty(String s)
检查字符串是否为非空
|
static boolean |
isWhitespace(int c) |
static Class<?> |
loadClass(String className)
根据字符串加载为一个类
|
static Properties |
loadProperties(URL url)
根据url加载配置集
|
static String |
md5(String str)
生成MD5
|
static String |
mergePath(String path1,
String path2)
合并两个路径
|
static <T> T |
newInstance(String className)
根据字段串加载为一个对象
|
static XMap |
pathVarMap(String path,
String expr)
将路径根据表达式转成map
|
static Throwable |
throwableUnwrap(Throwable ex) |
static RuntimeException |
throwableWrap(Throwable ex) |
public static final ExecutorService commonPool
public static String guid()
public static RuntimeException throwableWrap(Throwable ex)
public static boolean isEmpty(String s)
public static boolean isNotEmpty(String s)
public static boolean isBlank(String s)
public static boolean isWhitespace(int c)
public static <T> T firstOrNull(List<T> list)
public static <T> T newInstance(String className)
public static Enumeration<URL> getResources(String name) throws IOException
name - 资源名称IOExceptionpublic static String getResourceAsString(String name, String charset)
name - 资源名称charset - 编码public static String getString(InputStream ins, String charset)
public static Properties loadProperties(URL url)
public static Properties buildProperties(String txt)
public static <T> T injectProperties(T bean,
Properties propS)
public static String buildExt(String extend, boolean autoMake)
extend - 扩展配置autoMake - 是否自动创建public static void bindTo(Map<String,String> source, Object target)
public static void bindTo(Properties source, Object target)
Copyright © 2020. All rights reserved.