mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
优化工具类
This commit is contained in:
parent
9af1c5b7f8
commit
78e05bd8d9
@ -53,7 +53,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
|
|
||||||
public class FlexConfiguration extends Configuration {
|
public class FlexConfiguration extends Configuration {
|
||||||
|
|
||||||
private static Map<String, MappedStatement> dynamicMappedStatementCache = new ConcurrentHashMap<>();
|
private static final Map<String, MappedStatement> dynamicMappedStatementCache = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public FlexConfiguration(Environment environment) {
|
public FlexConfiguration(Environment environment) {
|
||||||
super(environment);
|
super(environment);
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import java.util.function.Predicate;
|
|||||||
* @author michael
|
* @author michael
|
||||||
* @date 17/3/21
|
* @date 17/3/21
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public class ClassUtil {
|
public class ClassUtil {
|
||||||
|
|
||||||
private ClassUtil() {
|
private ClassUtil() {
|
||||||
|
|||||||
@ -28,11 +28,12 @@ public class ConvertUtil {
|
|||||||
private ConvertUtil() {
|
private ConvertUtil() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
public static Object convert(Object value, Class targetClass) {
|
public static Object convert(Object value, Class targetClass) {
|
||||||
return convert(value, targetClass, false);
|
return convert(value, targetClass, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public static Object convert(Object value, Class targetClass, boolean ignoreConvertError) {
|
public static Object convert(Object value, Class targetClass, boolean ignoreConvertError) {
|
||||||
if (value == null && targetClass.isPrimitive()) {
|
if (value == null && targetClass.isPrimitive()) {
|
||||||
return getPrimitiveDefaultValue(targetClass);
|
return getPrimitiveDefaultValue(targetClass);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user