Class Pretty
- java.lang.Object
-
- org.glassfish.jersey.internal.util.Pretty
-
public class Pretty extends Object
Utility class to print the variety of types, useful intoStringmethod.- Author:
- John Wells (john.wells at oracle.com)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringarray(Object[] array)Returns a pretty string for the given array.static Stringclazz(Class<?> clazz)Makes a nice, pretty class (without the package name).static Stringcollection(Collection<?> collection)Returns a pretty string representing the collection.static Stringconstructor(Constructor<?> constructor)Make a nice pretty string out of the constructor and all its parameters.static Stringfield(Field field)Returns a pretty string representing a Field.static Stringmethod(Method method)Makes a nice pretty string of the method, with the method name and all parameters.static StringpType(ParameterizedType pType)Prints a pretty parameterized type.static Stringtype(Type t)Returns a pretty string for the given type.
-
-
-
Method Detail
-
clazz
public static String clazz(Class<?> clazz)
Makes a nice, pretty class (without the package name).- Parameters:
clazz- Make me a pretty class.- Returns:
- A nice string of the class, with no package.
-
pType
public static String pType(ParameterizedType pType)
Prints a pretty parameterized type.- Parameters:
pType- The parameterized type to print. May not be null.- Returns:
- A pretty string version of the parameterized type.
-
type
public static String type(Type t)
Returns a pretty string for the given type.- Parameters:
t- A possibly null type.- Returns:
- A pretty string representing the type.
-
constructor
public static String constructor(Constructor<?> constructor)
Make a nice pretty string out of the constructor and all its parameters.- Parameters:
constructor- The constructor to make pretty.- Returns:
- A nice pretty string.
-
method
public static String method(Method method)
Makes a nice pretty string of the method, with the method name and all parameters.- Parameters:
method- The method to make pretty.- Returns:
- A nice pretty string.
-
field
public static String field(Field field)
Returns a pretty string representing a Field.- Parameters:
field- The possibly null field.- Returns:
- A pretty string representing the field.
-
array
public static String array(Object[] array)
Returns a pretty string for the given array.- Parameters:
array- The possibly null array to represent.- Returns:
- A pretty string representation of the array.
-
collection
public static String collection(Collection<?> collection)
Returns a pretty string representing the collection.- Parameters:
collection- A possibly null collection to represent.- Returns:
- A pretty string representing the collection.
-
-