## org.eclipse.ocl.util
Class ObjectUtil

    java.lang.Object
      org.eclipse.ocl.util.ObjectUtil

    public class ObjectUtil

extends Object

Certain generic utility operations on objects.

Constructor Summary
`ObjectUtil()`

Method Summary
`static void` `dispose(Object object)` Disposes of the specified `object`.
`static boolean` `equal(Object anObject, Object anotherObject)` Computes the equivalence of two objects, accounting for primitive numeric values that OCL considers equal but Java does not.
`static int` `hashCode(Object anObject)` Computes hash of an object, accounting for the similar hashing of primitive numeric values that OCL considers equal but Java does not.
`static boolean` `isPrimitive(Object o)` Queries whether the specified object represents an OCL primitive value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ObjectUtil

    public ObjectUtil()

Method Detail

### equal

    public static boolean equal(Object anObject,
                                Object anotherObject)

  Computes the equivalence of two objects, accounting for primitive numeric values that OCL considers equal but Java does not. This is also safe when either value is `null`.

  Parameters:
    `anObject` - an object or `null`
    `anotherObject` - another object or `null`
  Returns:
    whether they are equivalent as far as OCL is concerned

### hashCode

    public static int hashCode(Object anObject)

  Computes hash of an object, accounting for the similar hashing of primitive numeric values that OCL considers equal but Java does not. It is also safe with `null` values.

  Parameters:
    `anObject` - an object or `null`
  Returns:
    its OCL hash

### isPrimitive

    public static boolean isPrimitive(Object o)

  Queries whether the specified object represents an OCL primitive value.

  Parameters:
    `o` - an object
  Returns:
    whether it is an OCL primitive value

### dispose

    public static void dispose(Object object)

  Disposes of the specified `object`. If, in particular, it is an `EObject`, then it and all of its contents will have their adapter-lists cleared.

  Parameters:
    `object` - an object to dispose
  Since:
    1.2

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.