mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
feat: optimize ConvertUtil.java
This commit is contained in:
parent
b499e892c5
commit
b96cf3d2da
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.mybatisflex.core.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDate;
|
||||
@ -45,6 +46,9 @@ public class ConvertUtil {
|
||||
if (value.getClass().isAssignableFrom(targetClass)) {
|
||||
return value;
|
||||
}
|
||||
if (targetClass == Serializable.class && ArrayUtil.contains(value.getClass().getInterfaces(), Serializable.class)) {
|
||||
return value;
|
||||
}
|
||||
if (targetClass == String.class) {
|
||||
return value.toString();
|
||||
} else if (targetClass == Integer.class || targetClass == int.class) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user