org.jcoderz.commons.util
Class ObjectUtil

java.lang.Object
  extended by org.jcoderz.commons.util.ObjectUtil

public final class ObjectUtil
extends Object

This class provides object related utility functions.

Author:
Michael Griffel

Method Summary
static boolean equals(boolean a, boolean b)
          Returns true if the two values are equal to one another.
static boolean equals(char a, char b)
          Returns true if the two values are equal to one another.
static boolean equals(int a, int b)
          Returns true if the two values are equal to one another.
static boolean equals(long a, long b)
          Returns true if the two values are equal to one another.
static boolean equals(Object a, Object b)
          Returns true if the two specified objects are equal to one another.
static String toString(Object obj)
          Returns the string representation of the object or null if the object is null.
static String toStringOrEmpty(Object obj)
          Returns the string representation of the object or an empty string if the object is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(Object a,
                             Object b)
Returns true if the two specified objects are equal to one another. Two objects a and b are considered equal if (a==null ? b == null : a.equals(b)). Also, two object references are considered equal if both are null. This method allow easy implementation of the equals method.

Parameters:
a - one object to be tested for equality.
b - the other object to be tested for equality.
Returns:
true if the two objects are equal; false otherwise.

equals

public static boolean equals(long a,
                             long b)
Returns true if the two values are equal to one another. This method allow easy implementation of the equals method.

Parameters:
a - value to be tested for equality.
b - the other value to be tested for equality.
Returns:
true if the two value are equal; false otherwise.

equals

public static boolean equals(int a,
                             int b)
Returns true if the two values are equal to one another. This method allow easy implementation of the equals method.

Parameters:
a - value to be tested for equality.
b - the other value to be tested for equality.
Returns:
true if the two value are equal; false otherwise.

equals

public static boolean equals(char a,
                             char b)
Returns true if the two values are equal to one another. This method allow easy implementation of the equals method.

Parameters:
a - value to be tested for equality.
b - the other value to be tested for equality.
Returns:
true if the two value are equal; false otherwise.

equals

public static boolean equals(boolean a,
                             boolean b)
Returns true if the two values are equal to one another. This method allow easy implementation of the equals method.

Parameters:
a - value to be tested for equality.
b - the other value to be tested for equality.
Returns:
true if the two value are equal; false otherwise.

toString

public static String toString(Object obj)
Returns the string representation of the object or null if the object is null.

Parameters:
obj - the object to be converted or null.
Returns:
the string representation of the object or null if the object is null.

toStringOrEmpty

public static String toStringOrEmpty(Object obj)
Returns the string representation of the object or an empty string if the object is null.

Parameters:
obj - the object to be converted or null.
Returns:
the string representation of the object or an empty string if the object is null.


Copyright 2007 The jCoderZ Project.