@Immutable public final class CGStringHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getClassFromPath(String sPath)
Get the class name of the passed path.
|
static String |
getClassLocalName(Class<?> aClass)
Get the name of the class without the package.
|
static String |
getClassLocalName(Object aObject)
Get the name of the object's class without the package.
|
static String |
getClassLocalName(String sClassName)
Get the name of the class without the package.
|
static String |
getClassPackageName(Class<?> aClass)
Get the name of the package the passed class resides in.
|
static String |
getClassPackageName(String sClassName)
Get the name of the package the passed class resides in.
|
static String |
getDirectoryFromPackage(Package aPackage)
Convert a package name to a relative directory name.
|
static String |
getDirectoryFromPackage(String sPackage)
Convert a package name to a relative directory name.
|
static String |
getObjectAddress(Object aObject)
Get the hex representation of the passed object's address.
|
static String |
getPathFromClass(Class<?> aClass)
Get the path representation of the passed class.
|
static String |
getPathFromClass(String sClassName)
Get the path representation of the passed class name.
|
static String |
getSafeClassName(Object aObject)
Get the class name of the passed object.
|
@Nonnull public static String getClassLocalName(@Nonnull Object aObject)
aObject - The object to get the information from. May not be null
.@Nonnull public static String getClassLocalName(@Nonnull Class<?> aClass)
aClass - The class to get the information from. May not be null.@Nonnull public static String getClassLocalName(@Nonnull String sClassName)
sClassName - The fully qualified name of the class. May not be null.null.@Nonnull public static String getClassPackageName(@Nonnull Class<?> aClass)
aClass - The class to get the information from. May not be null.@Nonnull public static String getClassPackageName(@Nonnull String sClassName)
sClassName - The name class to get the information from. May not be
null.@Nonnull public static String getSafeClassName(@Nullable Object aObject)
Class, its name is retrieved, other Object.getClass() is called.aObject - The object who's class name is to be retrieved."null" for a null parameter@Nonnull public static String getDirectoryFromPackage(@Nonnull Package aPackage)
aPackage - The package to be converted. May not be null.@Nonnull public static String getDirectoryFromPackage(@Nonnull String sPackage)
sPackage - The name of the package to be converted. May not be
null.@Nonnull public static String getPathFromClass(@Nonnull Class<?> aClass)
aClass - The class of which the path is to be retrieved. May not be
null.null.@Nonnull public static String getPathFromClass(@Nonnull String sClassName)
sClassName - The class name of which the path is to be retrieved.@Nonnull public static String getClassFromPath(@Nonnull String sPath)
sPath - The path to be converted. May not be null.@Nonnull @Nonempty public static String getObjectAddress(@Nullable Object aObject)
aObject - The object who's address is to be retrieved. May be
null.System.identityHashCode(Object)Copyright © 2006–2015 phloc systems. All rights reserved.