Package panda.utilities
Class PackageUtils
java.lang.Object
panda.utilities.PackageUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringgetPackageName(Class<?> clazz) Get package name (supports primitives)static StringgetShortenPackage(Class<?> clazz) Display package using only first lettersstatic StringgetShortenPackage(String pack) Display package using only first lettersstatic @Nullable StringPackage to stringstatic StringPackage to string
-
Method Details
-
getShortenPackage
Display package using only first letters- Parameters:
clazz- the class to use- Returns:
- the formatted package
- See Also:
-
getShortenPackage
Display package using only first letters- Parameters:
pack- the package represented by string (with class name at the end)- Returns:
- the formatted package
-
getPackageName
Get package name (supports primitives)- Parameters:
clazz- the class to get the package- Returns:
- the package name or null if class does not have package
-
toString
public static String toString(@Nullable @Nullable Package pack, @Nullable @Nullable String defaultValue) Package to string- Parameters:
pack- the package to stringifydefaultValue- the value returned when the package is null- Returns:
- the package name or the default value if package is null
-
toString
Package to string- Parameters:
pkg- the package to stringify- Returns:
- the package name or null if the package is null
-