|
23 | 23 |
|
24 | 24 | /** |
25 | 25 | * 工具类 |
26 | | - * @version alafighting 2016-04 |
27 | 26 | */ |
28 | 27 | public final class Utils { |
29 | 28 |
|
@@ -64,58 +63,6 @@ public static void checkOffsetAndCount(int arrayLength, int offset, int count) { |
64 | 63 | } |
65 | 64 | } |
66 | 65 |
|
67 | | - /** |
68 | | - * 取父类泛型 |
69 | | - * @param clazz |
70 | | - * @return 没有则返回null |
71 | | - */ |
72 | | - @SuppressWarnings("rawtypes") |
73 | | - public static Type[] getGenericSuperclass(Class<?> clazz) { |
74 | | - try { |
75 | | - Type typeGeneric = clazz.getGenericSuperclass(); |
76 | | - if (typeGeneric != null) { |
77 | | - if (typeGeneric instanceof ParameterizedType) { |
78 | | - return getGeneric((ParameterizedType) typeGeneric); |
79 | | - } |
80 | | - } |
81 | | - } catch (Exception e) { |
82 | | - } |
83 | | - return null; |
84 | | - } |
85 | | - /** |
86 | | - * 取父接口泛型 |
87 | | - * @param clazz |
88 | | - * @return 没有则返回null |
89 | | - */ |
90 | | - @SuppressWarnings("rawtypes") |
91 | | - public static Type[] getGenericInterfaces(Class<?> clazz) { |
92 | | - try { |
93 | | - Type typeGeneric = clazz.getGenericInterfaces()[0]; |
94 | | - if (typeGeneric != null) { |
95 | | - if (typeGeneric instanceof ParameterizedType) { |
96 | | - return getGeneric((ParameterizedType) typeGeneric); |
97 | | - } |
98 | | - } |
99 | | - } catch (Exception e) { |
100 | | - } |
101 | | - return null; |
102 | | - } |
103 | | - /** |
104 | | - * 取泛型 |
105 | | - * @param type |
106 | | - * @return 没有则返回null |
107 | | - */ |
108 | | - @SuppressWarnings("rawtypes") |
109 | | - public static Type[] getGeneric(ParameterizedType type) { |
110 | | - try { |
111 | | - if (type != null) { |
112 | | - return type.getActualTypeArguments(); |
113 | | - } |
114 | | - } catch (Exception e) { |
115 | | - } |
116 | | - return null; |
117 | | - } |
118 | | - |
119 | 66 | public static Class<?> getRawType(Type type) { |
120 | 67 | if (type == null) throw new NullPointerException("type == null"); |
121 | 68 |
|
@@ -173,7 +120,6 @@ public static String buildKey(Request request) { |
173 | 120 | str.append(request.url()); |
174 | 121 | str.append(']'); |
175 | 122 |
|
176 | | - |
177 | 123 | try { |
178 | 124 | Buffer buffer = new Buffer(); |
179 | 125 | request.body().writeTo(buffer); |
|
0 commit comments