Package org.minifx.workbench.util
Class Names
- java.lang.Object
-
- org.minifx.workbench.util.Names
-
public final class Names extends java.lang.Object
Utility methods to determine names for objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<java.lang.String>
nameFromNameMethod(java.lang.Object object)
Tries to get the name of an object from one of its methods.
-
-
-
Method Detail
-
nameFromNameMethod
public static final java.util.Optional<java.lang.String> nameFromNameMethod(java.lang.Object object)
Tries to get the name of an object from one of its methods. Only methods which return strings and have no parameters are considered. the search is done in the following order:- "name()"
- "getName()"
- Parameters:
object
- the object for which to retrieve the name- Returns:
- the name as derived from a name method, if available.
-
-