Package org.openwms.tms.impl.state
Class TransportStartComparator
java.lang.Object
org.openwms.tms.impl.state.TransportStartComparator
- All Implemented Interfaces:
Serializable
,Comparator<TransportOrder>
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.
- Author:
- Heiko Scherrer
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(TransportOrder o1, TransportOrder o2) First the priority or orders is compared, when both are equals the id is compared too.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 Details
-
TransportStartComparator
TransportStartComparator()
-
-
Method Details
-
compare
First the priority or orders is compared, when both are equals the id is compared too.- Specified by:
compare
in interfaceComparator<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:
-