com.cumulocity.model
Class Util

java.lang.Object
  extended by com.cumulocity.model.Util

public class Util
extends Object

This class contains convenience methods for core model objects. The methods are mainly used to deal with null objects in a graceful manner.

Author:
Sameer Babu KK

Method Summary
static boolean equals(Object a, Object b)
          Compare two objects.
static int getHashCode(Object o)
          A small wrapper around hashCode() which return 0 for a null object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static final boolean equals(Object a,
                                   Object b)
Compare two objects. These objects are considered equal if both are null, or if equals() returns true. This method is here only to remove complexity and increase legibility in equals() methods.

Parameters:
a -
b -
Returns:

getHashCode

public static final int getHashCode(Object o)
A small wrapper around hashCode() which return 0 for a null object.

Parameters:
o - The object whose hash code is to be computed.
Returns:
null, if the object is null, its hash code otherwise.


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.