@Test public void typeTest() { Assert.assertEquals(boolean.class, signType("Z").returnType); Assert.assertEquals(void.class, signType("V").returnType); Assert.assertEquals(long.class, signType("J").returnType); Assert.assertEquals(short.class, signType("S").returnType); Assert.assertEquals(int.class, signType("I").returnType); Assert.assertEquals(byte.class, signType("B").returnType); Assert.assertEquals(double[].class, signType("[D").returnType); Assert.assertEquals(Object[].class, signType("[Ljava/lang/Object;").returnType); }
private Value<Class<?>> type(String str) { Conditions.checkState(type, For.METHOD, For.FIELD, For.CONSTRUCTOR); Conditions.nonNullOrEmpty(str, "str"); int index = str.lastIndexOf(")") + 1; try { return Value.of((index > 0) ? toClass(str.substring(index)) : toClass(str)); } catch (ClassNotFoundException exception) { return Value.empty(); } }
AbstractSignatureLookup implements SignatureLookup<T> { private Value<Class<?>> type(String str) { Conditions.checkState(type, For.METHOD, For.FIELD, For.CONSTRUCTOR); Conditions.nonNullOrEmpty(str, "str"); int index = str.lastIndexOf(")") + 1; try { return Value.of((index > 0) ? toClass(str.substring(index)) : toClass(str)); } catch (ClassNotFoundException exception) { return Value.empty(); } } }
AbstractSignatureLookup implements SignatureLookup<T> { private Value<Class<?>> type(String str) { Conditions.checkState(type, For.METHOD, For.FIELD, For.CONSTRUCTOR); Conditions.nonNullOrEmpty(str, "str"); int index = str.lastIndexOf(")") + 1; try { return Value.of((index > 0) ? toClass(str.substring(index)) : toClass(str)); } catch (ClassNotFoundException exception) { return Value.empty(); } } AbstractSignatureLookup(String signature, Class<?> from, For type); }
AbstractSignatureLookup implements SignatureLookup<T> { private Value<Class<?>> type(String str) { Conditions.checkState(type, For.METHOD, For.FIELD, For.CONSTRUCTOR); Conditions.nonNullOrEmpty(str, "str"); int index = str.lastIndexOf(")") + 1; try { return Value.of((index > 0) ? toClass(str.substring(index)) : toClass(str)); } catch (ClassNotFoundException exception) { return Value.empty(); } } AbstractSignatureLookup(String signature, Class<?> from, For type);  }
AbstractSignatureLookup implements SignatureLookup<T> { private Value<Class<?>> type(String str) { Conditions.checkState(type, For.METHOD, For.FIELD, For.CONSTRUCTOR); Conditions.nonNullOrEmpty(str, "str"); int index = str.lastIndexOf(")") + 1; try { return Value.of((index > 0) ? toClass(str.substring(index)) : toClass(str)); } catch (ClassNotFoundException exception) { return Value.empty(); } } AbstractSignatureLookup(String signature, Class<?> from, For type);   }