Package com.globalmentor.model
Class Labels
java.lang.Object
com.globalmentor.model.Labels
Utilities for working with human-readable representations of objects.
- Author:
- Garret Wilson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CharSequence
Determines a human-readable representation of a given object.
-
Constructor Details
-
Labels
public Labels()
-
-
Method Details
-
getLabel
Determines a human-readable representation of a given object.If the object is
Labeled
,Labeled.getLabel()
is returned. Otherwise, if the object is aCharSequence
it is returned unchanged; if not,Object.toString()
is returned.- Parameters:
object
- The object for which a label should be determined.- Returns:
- A label meant for human consumption identifying the object.
- Throws:
NullPointerException
- if the given object isnull
.- See Also:
-