-
Notifications
You must be signed in to change notification settings - Fork 1
/
KotlinUtils.java
46 lines (34 loc) · 1.13 KB
/
KotlinUtils.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
public class KotlinUtils{
public static String cngType(String orgType){
if(orgType.contains("?")) orgType = orgType.replace("?", "");
if(orgType.equals("Any")) return "Object";
if(orgType.equals("Int")) return "Integer";
return orgType;
}
public static String chkType(String chk){
if(chk.contains("listOf(")){
String chker;
if(chk.contains(",")) chker = chk.split(",")[0].split("\\(")[1];
else chker = chk.split("\\(")[1].split("\\)")[0];
return chkDetail(chker) + "[]";
}
return chkDetail(chk);
}
public static String chkDetail(String chk){
if(chk.contains("\"")) return "String";
else {
if(chk.contains(".")){
try{
Double.parseDouble(chk);
return "Double";
} catch(Exception e){}
}
}
return "Integer";
}
public static String cngListOf(String chk){
chk = chk.replace("listOf(", "{");
chk = chk.substring(0, chk.length() - 1) + "}";
return chk;
}
}