Package com.globalmentor.model
Class Labels
- java.lang.Object
-
- com.globalmentor.model.Labels
-
public class Labels extends java.lang.Object
Utilities for working with human-readable representations of objects.- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Constructor Description Labels()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.CharSequence
getLabel(java.lang.Object object)
Determines a human-readable representation of a given object.
-
-
-
Method Detail
-
getLabel
public static java.lang.CharSequence getLabel(java.lang.Object object)
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:
java.lang.NullPointerException
- if the given object isnull
.- See Also:
Labeled.getLabel()
-
-