org.openwms.tms.domain.comparator
Class TransportStartComparator
java.lang.Object
org.openwms.tms.domain.comparator.TransportStartComparator
- All Implemented Interfaces:
- Serializable, Comparator<TransportOrder>
public class TransportStartComparator
- extends Object
- implements Comparator<TransportOrder>, Serializable
A TransportStartComparator. I used to sort TransportOrders is a particular
order. Unfortunately some fields of the TransportOrder class are defined as
Enums for a better handling in business logic. Persisting these fields as
Strings makes it impossible to do a proper sorting in the database with JPA.
Hence we must do it with Comparators in the application layer.
- Since:
- 0.1
- Version:
- $Revision: 1583 $
- Author:
- Heiko Scherrer
- See Also:
PriorityLevel
,
Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransportStartComparator
public TransportStartComparator()
compare
public int compare(TransportOrder o1,
TransportOrder o2)
- First the priority or orders is compared, when both are equals the id is
compared too.
- Specified by:
compare
in interface Comparator<TransportOrder>
- Parameters:
o1
- FirstOrder to compareo2
- Second order to compare
- Returns:
- a negative integer, zero, or a positive integer as the first
argument is less than, equal to, or greater than the second.
- See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
Copyright © 2005-2011 openwms.org. All Rights Reserved.