Package com.ocs.dynamo.domain.comparator
Class AttributeComparator<T extends AbstractEntity<?>>
- java.lang.Object
-
- com.ocs.dynamo.domain.comparator.AttributeComparator<T>
-
- All Implemented Interfaces:
Comparator<T>
public class AttributeComparator<T extends AbstractEntity<?>> extends Object implements Comparator<T>
A comparator for comparing two entities based on a value of an attribute (using reflection)- Author:
- bas.rutten
-
-
Constructor Summary
Constructors Constructor Description AttributeComparator(String attribute)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(T o1, T o2)-
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
-
AttributeComparator
public AttributeComparator(String attribute)
Constructor- Parameters:
attribute-
-
-
Method Detail
-
compare
public int compare(T o1, T o2)
- Specified by:
comparein interfaceComparator<T extends AbstractEntity<?>>
-
-