Class ObjectComparator

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Comparator<java.lang.Object>

    public class ObjectComparator
    extends java.lang.Object
    implements java.util.Comparator<java.lang.Object>, java.io.Serializable
    Compares two objects using their string representation.
    Since:
    11.02.2009
    Version:
    $Revision: 1.6 $
    Author:
    oliver
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object o1, java.lang.Object o2)
      Compare.
      • 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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • ObjectComparator

        public ObjectComparator()
    • Method Detail

      • compare

        public int compare​(java.lang.Object o1,
                           java.lang.Object o2)
        Compare.
        Specified by:
        compare in interface java.util.Comparator<java.lang.Object>
        Parameters:
        o1 - the object 1
        o2 - the object 2
        Returns:
        0 if both are equals
        See Also:
        Comparator.compare(java.lang.Object, java.lang.Object)