org.eobjects.metamodel.util
Class ObjectComparator

java.lang.Object
  extended by org.eobjects.metamodel.util.ObjectComparator
All Implemented Interfaces:
Comparator<Object>

public final class ObjectComparator
extends Object
implements Comparator<Object>

General purpose comparator to use for objects of various kinds. Prevents NullPointerExceptions and tries to use comparable interface if available and appropriate on incoming objects.


Method Summary
 int compare(Object o1, Object o2)
           
static Comparable<Object> getComparable(Object o)
           
static Comparator<Object> getComparator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

getComparator

public static Comparator<Object> getComparator()

getComparable

public static Comparable<Object> getComparable(Object o)

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator<Object>


Copyright © 2007-2013. All Rights Reserved.