提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.data.point.common; |
H |
2 |
|
|
3 |
import java.math.BigDecimal; |
|
4 |
|
|
5 |
/** |
|
6 |
* @author PanZhibao |
|
7 |
* @Description |
|
8 |
* @createTime 2023年12月06日 13:12:00 |
|
9 |
*/ |
|
10 |
public class PointDataTypeUtils { |
|
11 |
|
|
12 |
public static Object convert(Object value, String type) { |
|
13 |
switch (type) { |
|
14 |
case "int": |
|
15 |
return Integer.parseInt(value.toString()); |
|
16 |
case "float": |
|
17 |
return new BigDecimal(value.toString()); |
|
18 |
case "boolean": |
|
19 |
return Boolean.parseBoolean(value.toString()); |
|
20 |
default: |
|
21 |
break; |
|
22 |
} |
|
23 |
return value; |
|
24 |
} |
|
25 |
} |