@Test public void shouldDecapitalizeSomeCharsUntilItFindsOneUppercased() throws NoSuchMethodException { Assert.assertEquals("urlClassLoader",extractor.nameFor(URLClassLoader.class)); Assert.assertEquals("bigDecimal",extractor.nameFor(BigDecimal.class)); Assert.assertEquals("string",extractor.nameFor(String.class)); Assert.assertEquals("aClass",extractor.nameFor(AClass.class)); Assert.assertEquals("url",extractor.nameFor(URL.class)); }
public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); } }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }  }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }  String nameFor(Type generic); }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }  String nameFor(Type generic);  }