Get Instance Name

Is there a method like this? EntityValues.getInstanceName(object)? Or is there another Class that can achieve this? I need to get the instanceName of an entity object and cant find how to do it.

nevermind… its in the documentation.

metadataTools.getInstanceName(entity)