public final class PackageUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static @Nullable String |
getPackageName(Class<?> clazz)
Get package name (supports primitives)
|
static String |
getShortenPackage(Class<?> clazz)
Display package using only first letters
|
static String |
getShortenPackage(String pack)
Display package using only first letters
|
static @Nullable String |
toString(@Nullable Package pkg)
Package to string
|
static String |
toString(@Nullable Package pack,
@Nullable String defaultValue)
Package to string
|
public static String getShortenPackage(Class<?> clazz)
clazz - the class to usegetShortenPackage(String)public static String getShortenPackage(String pack)
pack - the package represented by string (with class name at the end)@Nullable public static @Nullable String getPackageName(Class<?> clazz)
clazz - the class to get the packagepublic static String toString(@Nullable @Nullable Package pack, @Nullable @Nullable String defaultValue)
pack - the package to stringifydefaultValue - the value returned when the package is nullCopyright © 2020. All rights reserved.