Package it.tidalwave.util
Class ShortNames
java.lang.Object
it.tidalwave.util.ShortNames
A utility that returns short qualified names for class literals and objects.
- Since:
- 3.2-ALPHA-17
- Author:
- Fabrizio Giudici
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Return the short name for an object.static String
Return the short names for some objects.static String
Return the short names for some objects.static String
Returns the short name for a class literal.static String
Returns the short name for a class literal, eventually adding interface names (but not those in the java.* package).static String
shortNames
(Iterable<Class<?>> classes) Returns the short name for class literals, eventually adding interface names (but not those in the java.* package).
-
Constructor Details
-
ShortNames
public ShortNames()
-
-
Method Details
-
shortName
Returns the short name for a class literal.- Parameters:
clazz
- the class- Returns:
- the short name
-
shortName
Returns the short name for a class literal, eventually adding interface names (but not those in the java.* package).- Parameters:
clazz
- the classwithInterfaces
- whether the interfaces must be listed- Returns:
- the short name
-
shortNames
Returns the short name for class literals, eventually adding interface names (but not those in the java.* package).- Parameters:
classes
- the classes- Returns:
- the short names
-
shortId
Return the short name for an object. If the object contains a method namedgetId()
, the id is part of the result.- Parameters:
object
- the object- Returns:
- the short name
-
shortIds
Return the short names for some objects.- Parameters:
objects
- the objects- Returns:
- the short names
-
shortIds
Return the short names for some objects.- Parameters:
objects
- the objects- Returns:
- the short names
-