Package org.eclipse.emf.compare.internal.spec

# Class EObjectUtil

java.lang.Object
org.eclipse.emf.compare.internal.spec.EObjectUtil

public final class EObjectUtil extends Object
Static utilities to create human readable EObject.toString() methods.

## Method Summary

Modifier and Type
Method
Description
`static String`
`getLabel(EObject object)`
Returns a String label for the given EObject given the following rules : if the given `object` is `null`, returns the String `"<null>"` if not null, return the name of the `EClass` of the given `object` and the hex string of the object hashcode.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getLabel

public static String getLabel(EObject object)
Returns a String label for the given EObject given the following rules :

- if the given `object` is `null`, returns the String `"<null>"`
- if not null, return the name of the `EClass` of the given `object` and the hex string of the object hashcode. It is followed by the value of the `EStructuralFeature` name if the given `object` has one or the first EAttribute with an instance class equals to String. (same rule as in the ReflectiveItemProvider)

Parameters:
  `object` - the object to get the label from.
Returns:
  the label.