diff --git a/test/org/redkale/test/type/OneBean.java b/test/org/redkale/test/type/OneBean.java new file mode 100644 index 000000000..b8ec19c49 --- /dev/null +++ b/test/org/redkale/test/type/OneBean.java @@ -0,0 +1,15 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + */ +public class OneBean { + + public int id; +} diff --git a/test/org/redkale/test/type/OneRound.java b/test/org/redkale/test/type/OneRound.java new file mode 100644 index 000000000..a90a680c8 --- /dev/null +++ b/test/org/redkale/test/type/OneRound.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + */ +public class OneRound { + +} diff --git a/test/org/redkale/test/type/OneService.java b/test/org/redkale/test/type/OneService.java new file mode 100644 index 000000000..88f6b9e40 --- /dev/null +++ b/test/org/redkale/test/type/OneService.java @@ -0,0 +1,22 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +import org.redkale.service.RetResult; + +/** + * + * @author zhangjx + * @param + * @param + */ +public class OneService { + + public RetResult run(OR round, OB bean) { + return RetResult.success(); + } + +} diff --git a/test/org/redkale/test/type/ThreeBean.java b/test/org/redkale/test/type/ThreeBean.java new file mode 100644 index 000000000..b17ec09de --- /dev/null +++ b/test/org/redkale/test/type/ThreeBean.java @@ -0,0 +1,15 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + */ +public class ThreeBean extends TwoBean { + + public String desc; +} diff --git a/test/org/redkale/test/type/ThreeRound.java b/test/org/redkale/test/type/ThreeRound.java new file mode 100644 index 000000000..a8487aec0 --- /dev/null +++ b/test/org/redkale/test/type/ThreeRound.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + */ +public class ThreeRound extends TwoRound { + +} diff --git a/test/org/redkale/test/type/ThreeService.java b/test/org/redkale/test/type/ThreeService.java new file mode 100644 index 000000000..777a6e688 --- /dev/null +++ b/test/org/redkale/test/type/ThreeService.java @@ -0,0 +1,20 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + * @param + * @param + * @param + */ +public class ThreeService extends OneService { + + public String key(K key) { + return "" + key; + } +} diff --git a/test/org/redkale/test/type/TwoBean.java b/test/org/redkale/test/type/TwoBean.java new file mode 100644 index 000000000..0797ecbc0 --- /dev/null +++ b/test/org/redkale/test/type/TwoBean.java @@ -0,0 +1,15 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + */ +public class TwoBean extends OneBean { + + public String name; +} diff --git a/test/org/redkale/test/type/TwoRound.java b/test/org/redkale/test/type/TwoRound.java new file mode 100644 index 000000000..6ed43badf --- /dev/null +++ b/test/org/redkale/test/type/TwoRound.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + */ +public class TwoRound extends OneRound { + +} diff --git a/test/org/redkale/test/type/TwoService.java b/test/org/redkale/test/type/TwoService.java new file mode 100644 index 000000000..40e0f251e --- /dev/null +++ b/test/org/redkale/test/type/TwoService.java @@ -0,0 +1,16 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +/** + * + * @author zhangjx + * @param + * @param + */ +public class TwoService extends OneService { + +} diff --git a/test/org/redkale/test/type/TypeTokenTest.java b/test/org/redkale/test/type/TypeTokenTest.java new file mode 100644 index 000000000..88b0c3d42 --- /dev/null +++ b/test/org/redkale/test/type/TypeTokenTest.java @@ -0,0 +1,26 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.test.type; + +import java.lang.reflect.Method; +import org.redkale.util.TypeToken; + +/** + * + * @author zhangjx + */ +public class TypeTokenTest { + + public static void main(String[] args) throws Throwable { + Class declaringClass = TwoService.class; + for (Method method : declaringClass.getMethods()) { + if (!"run".equals(method.getName())) continue; + System.out.println(TypeToken.getGenericType(method.getGenericParameterTypes()[0], declaringClass)); + break; + } + } + +}