#525 加强Utils Modules模块: 深夜的战果
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ import org.springside.examples.bootapi.repository.AccountDao;
|
||||
import org.springside.examples.bootapi.service.exception.ErrorCode;
|
||||
import org.springside.examples.bootapi.service.exception.ServiceException;
|
||||
import org.springside.modules.utils.text.Hashs;
|
||||
import org.springside.modules.utils.base.IdGenerator;
|
||||
import org.springside.modules.utils.misc.IdGenerator;
|
||||
import org.springside.modules.utils.text.Encodes;
|
||||
|
||||
import com.google.common.cache.Cache;
|
||||
|
||||
@@ -7,15 +7,15 @@ import org.apache.commons.lang3.SystemUtils;
|
||||
public class Platforms {
|
||||
|
||||
// 文件路径分隔符
|
||||
public static final String FILE_SEPARATOR = File.separator;
|
||||
public static final char FILE_SEPARATOR_CHAR = File.separatorChar;
|
||||
|
||||
// 换行符 JDK7可使用System.lineSeparator()
|
||||
public static final String LINE_SEPARATOR = SystemUtils.LINE_SEPARATOR;
|
||||
|
||||
public static final String FILE_PATH_SEPARATOR = File.separator;
|
||||
public static final char FILE_PATH_SEPARATOR_CHAR = File.separatorChar;
|
||||
|
||||
// ClassPath分隔符
|
||||
public static final String PATH_SEPARATOR = File.pathSeparator;
|
||||
public static final char PATH_SEPARATOR_CHAR = File.pathSeparatorChar;
|
||||
public static final String CLASS_PATH_SEPARATOR = File.pathSeparator;
|
||||
public static final char CLASS_PATH_SEPARATOR_CHAR = File.pathSeparatorChar;
|
||||
|
||||
// 换行符, JDK7可使用System.lineSeparator()
|
||||
public static final String LINE_SEPARATOR = SystemUtils.LINE_SEPARATOR;
|
||||
|
||||
// 临时目录
|
||||
public static final String TMP_DIR = SystemUtils.JAVA_IO_TMPDIR;
|
||||
|
||||
+3
@@ -10,10 +10,13 @@ import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springside.modules.utils.reflect.Reflections;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
|
||||
/**
|
||||
* 提取集合内元素的内容,依赖BeanUtils(考虑取消依赖)
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Beta
|
||||
public class CollectionExtractor {
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
*******************************************************************************/
|
||||
package org.springside.modules.utils.base;
|
||||
package org.springside.modules.utils.misc;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.UUID;
|
||||
@@ -1,5 +1,13 @@
|
||||
package org.springside.modules.utils.reflect;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
|
||||
/**
|
||||
* Class加载相关的工具类
|
||||
*
|
||||
* @author calvin
|
||||
*/
|
||||
@Beta
|
||||
public class ClassLoaders {
|
||||
|
||||
private static final String CLASS_FILE_NAME_EXTENSION = ".class";
|
||||
|
||||
@@ -17,11 +17,14 @@ import org.apache.commons.lang3.Validate;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
|
||||
/**
|
||||
* 反射工具类.
|
||||
*
|
||||
* 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数.
|
||||
*/
|
||||
@Beta
|
||||
public class Reflections {
|
||||
private static final String SETTER_PREFIX = "set";
|
||||
|
||||
|
||||
+2
-1
@@ -3,9 +3,10 @@
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
*******************************************************************************/
|
||||
package org.springside.modules.utils.base;
|
||||
package org.springside.modules.utils.misc;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springside.modules.utils.misc.IdGenerator;
|
||||
|
||||
public class IdGeneratorTest {
|
||||
|
||||
Reference in New Issue
Block a user