org.jjoost.util
Class Objects

java.lang.Object
  extended by org.jjoost.util.Objects

public class Objects
extends java.lang.Object

Defines a some simple utility methods for Objects

Author:
b.elliottsmith

Constructor Summary
Objects()
           
 
Method Summary
static boolean equalQuick(java.lang.Object a, java.lang.Object b)
          Perform simple object equality on the arguments without throwing an error if either argument is null
static
<E extends java.lang.Comparable<E>>
java.util.Comparator<E>
getComparableComparator()
          Return a Comparator which delegates to a Comparable object's compareTo() method
static java.lang.String toString(java.lang.Object o)
          Convert the provided argument to a String, return "null" of the argument is null
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Objects

public Objects()
Method Detail

equalQuick

public static boolean equalQuick(java.lang.Object a,
                                 java.lang.Object b)
Perform simple object equality on the arguments without throwing an error if either argument is null

Parameters:
a - an object
b - an object
Returns:
true if a and b are equal, false otherwise

getComparableComparator

public static <E extends java.lang.Comparable<E>> java.util.Comparator<E> getComparableComparator()
Return a Comparator which delegates to a Comparable object's compareTo() method

Returns:
a Comparator which delegates to a Comparable object's compareTo() method

toString

public static java.lang.String toString(java.lang.Object o)
Convert the provided argument to a String, return "null" of the argument is null

Parameters:
o - an object
Returns:
o == null ? "null" : o.toString()