@Test void getPackageName() { Assertions.assertAll( () -> Assertions.assertEquals("java.lang", PackageUtils.getPackageName(String.class)), () -> Assertions.assertNull(PackageUtils.getPackageName(void.class)) ); }
public static @Nullable String getPackageName(Class<?> clazz) { return clazz.getPackage() == null ? null : clazz.getPackage().getName(); }
PackageUtils { public static @Nullable String getPackageName(Class<?> clazz) { return clazz.getPackage() == null ? null : clazz.getPackage().getName(); } }
PackageUtils { public static @Nullable String getPackageName(Class<?> clazz) { return clazz.getPackage() == null ? null : clazz.getPackage().getName(); } private  PackageUtils(); }
PackageUtils { public static @Nullable String getPackageName(Class<?> clazz) { return clazz.getPackage() == null ? null : clazz.getPackage().getName(); } private  PackageUtils(); static String getShortenPackage(Class<?> clazz); static String getShortenPackage(String pack); static @Nullable String getPackageName(Class<?> clazz); static String toString(@Nullable Package pack, @Nullable String defaultValue); static @Nullable String toString(@Nullable Package pkg); }
PackageUtils { public static @Nullable String getPackageName(Class<?> clazz) { return clazz.getPackage() == null ? null : clazz.getPackage().getName(); } private  PackageUtils(); static String getShortenPackage(Class<?> clazz); static String getShortenPackage(String pack); static @Nullable String getPackageName(Class<?> clazz); static String toString(@Nullable Package pack, @Nullable String defaultValue); static @Nullable String toString(@Nullable Package pkg);  }