public final class PackageExtensions extends Object
PackageExtensions provides extension methods for the package of a Class
object| Constructor and Description |
|---|
PackageExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getPackageName(@NonNull Class<?> clazz)
Determines the package name from the given class object.
|
static String |
getPackageName(@NonNull String qualifiedClassName)
Determines the package name from the given String(this must be the fully qualified class name
without the file extension).
|
static String |
getPackageNameWithDot(@NonNull Class<?> clazz)
Determines the package name from the given class object and adds a dot at the end.
|
static String |
getPackagePath(@NonNull Class<?> clazz)
Determines the package path from the given class object.
|
static String |
getPackagePath(@NonNull Object object)
Determines the package path from the given object.
|
static String |
getPackagePath(@NonNull String packagePathWithDots)
Determines the package path from the given String object that is in the dot-format.
|
static String |
getPackagePath(@NonNull String packagePathWithDots,
boolean withEndSlash)
Determines the package path from the given String object that is in the dot-format.
|
static String |
getPackagePathWithSlash(@NonNull Class<?> clazz)
Determines the package path from the given object and adds a slash at the front.
|
static String |
getPackagePathWithSlash(@NonNull Object object)
Determines the package path from the given object and adds a slash at the front.
|
public static String getPackageName(@NonNull @NonNull Class<?> clazz)
clazz - The class object.public static String getPackageName(@NonNull @NonNull String qualifiedClassName)
qualifiedClassName - The fully qualified class name without the file extension. For instance:
xy.ab.Test => xy.abpublic static String getPackageNameWithDot(@NonNull @NonNull Class<?> clazz)
clazz - The class object.public static String getPackagePath(@NonNull @NonNull Class<?> clazz)
clazz - The class object.public static String getPackagePath(@NonNull @NonNull Object object)
object - The object.public static String getPackagePath(@NonNull @NonNull String packagePathWithDots)
packagePathWithDots - the package path with dotspublic static String getPackagePath(@NonNull @NonNull String packagePathWithDots, boolean withEndSlash)
packagePathWithDots - the package path with dotswithEndSlash - flag that indicates if a slash will be appended at the endpublic static String getPackagePathWithSlash(@NonNull @NonNull Class<?> clazz)
clazz - the clazzCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.