Class Pretty
java.lang.Object
org.glassfish.jersey.internal.util.Pretty
Utility class to print the variety of types, useful in
toString
method.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Pretty()
Private constructor to forbid the creation of Pretty instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns a pretty string for the given array.static String
Makes a nice, pretty class (without the package name).static String
collection
(Collection<?> collection) Returns a pretty string representing the collection.static String
constructor
(Constructor<?> constructor) Make a nice pretty string out of the constructor and all its parameters.static String
Returns a pretty string representing a Field.static String
Makes a nice pretty string of the method, with the method name and all parameters.private static String
prettyPrintParameters
(Class<?>[] params) static String
pType
(ParameterizedType pType) Prints a pretty parameterized type.static String
Returns a pretty string for the given type.
-
Field Details
-
DOT
- See Also:
-
NULL_STRING
- See Also:
-
CONSTRUCTOR_NAME
- See Also:
-
-
Constructor Details
-
Pretty
private Pretty()Private constructor to forbid the creation of Pretty instance.
-
-
Method Details
-
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
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
Returns a pretty string for the given type.- Parameters:
t
- A possibly null type.- Returns:
- A pretty string representing the type.
-
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
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
Returns a pretty string representing a Field.- Parameters:
field
- The possibly null field.- Returns:
- A pretty string representing the field.
-
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
Returns a pretty string representing the collection.- Parameters:
collection
- A possibly null collection to represent.- Returns:
- A pretty string representing the collection.
-
prettyPrintParameters
-