public class JavaTypeHelper extends Object
| Constructor and Description |
|---|
JavaTypeHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getPackageName(String className)
Returns the package portion of the specified class
|
static Class |
getPrimitiveClass(String primitiveName)
Returns the primitive class associated with the supplied primitive
type name.
|
static String |
getPrimitiveName(Class wrapper)
Returns the name of the primitive type associated with the supplied
wrapper class.
|
static String |
getShortClassName(String className)
Returns the name of a class without the package name.
|
static Class |
getWrapperClass(Class primitive)
Returns the wrapper class associated with the supplied primitive class.
|
static String |
getWrapperName(String primitiveName)
Returns the name of the wrapper class associated with the supplied
primitive type name.
|
static Boolean |
valueOf(boolean flag)
Returns the Boolean wrapper object for true or false
corresponding to the supplied argument.
|
public static String getPackageName(String className)
className - the name of the class from which to extract the
packagepublic static String getShortClassName(String className)
className - fully qualified classnamepublic static Class getWrapperClass(Class primitive)
primitive - the primitive class to be used for lookup.public static Class getPrimitiveClass(String primitiveName)
primitiveName - the name of the primitive to be used for lookup.public static String getWrapperName(String primitiveName)
primitiveName - the name of the primitive to be used for lookup.public static String getPrimitiveName(Class wrapper)
wrapper - the wrapper class to be used for lookup.public static Boolean valueOf(boolean flag)
flag - the primitive boolean object to be translated to a
Boolean wrapper.Copyright © 2019. All rights reserved.