@Test public void simpleNameOf() throws Exception { String NAME = "Test"; MatcherAssert.assertThat(TypeElementUtils.simpleNameOf("ru.test.test." + NAME), Is.is(NAME)); MatcherAssert.assertThat(TypeElementUtils.simpleNameOf("ru.test." + NAME), Is.is(NAME)); MatcherAssert.assertThat(TypeElementUtils.simpleNameOf(NAME), Is.is(NAME)); MatcherAssert.assertThat(TypeElementUtils.simpleNameOf(getClass().getName()), Is.is(getClass().getSimpleName())); }
public static String simpleNameOf(String s) { if (s.contains(".")) { return s.substring(s.lastIndexOf('.') + 1); } else { return s; } }
TypeElementUtils { public static String simpleNameOf(String s) { if (s.contains(".")) { return s.substring(s.lastIndexOf('.') + 1); } else { return s; } } }
TypeElementUtils { public static String simpleNameOf(String s) { if (s.contains(".")) { return s.substring(s.lastIndexOf('.') + 1); } else { return s; } } private  TypeElementUtils(); }
TypeElementUtils { public static String simpleNameOf(String s) { if (s.contains(".")) { return s.substring(s.lastIndexOf('.') + 1); } else { return s; } } private  TypeElementUtils(); static boolean isAbstract(@NonNull TypeElement element); static ImmutableList<ExecutableElement> getConstructors(@NonNull TypeElement element); static ImmutableList<ExecutableElement> getConstructorsWithAnnotation(
      List<ExecutableElement> constructors, Class<? extends Annotation> annotation); static String packageNameOf(final TypeElement type); static String simpleNameOf(String s); }
TypeElementUtils { public static String simpleNameOf(String s) { if (s.contains(".")) { return s.substring(s.lastIndexOf('.') + 1); } else { return s; } } private  TypeElementUtils(); static boolean isAbstract(@NonNull TypeElement element); static ImmutableList<ExecutableElement> getConstructors(@NonNull TypeElement element); static ImmutableList<ExecutableElement> getConstructorsWithAnnotation(
      List<ExecutableElement> constructors, Class<? extends Annotation> annotation); static String packageNameOf(final TypeElement type); static String simpleNameOf(String s);  }