Class PackageUtils

java.lang.Object
panda.utilities.PackageUtils

public final class PackageUtils extends Object
  • Method Details

    • getShortenPackage

      public static String getShortenPackage(Class<?> clazz)
      Display package using only first letters
      Parameters:
      clazz - the class to use
      Returns:
      the formatted package
      See Also:
    • getShortenPackage

      public static String getShortenPackage(String pack)
      Display package using only first letters
      Parameters:
      pack - the package represented by string (with class name at the end)
      Returns:
      the formatted package
    • getPackageName

      @Nullable public static @Nullable String getPackageName(Class<?> clazz)
      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 stringify
      defaultValue - the value returned when the package is null
      Returns:
      the package name or the default value if package is null
    • toString

      @Nullable public static @Nullable String toString(@Nullable @Nullable Package pkg)
      Package to string
      Parameters:
      pkg - the package to stringify
      Returns:
      the package name or null if the package is null