Class DefaultExchangeComparator
java.lang.Object
org.apache.camel.processor.resequencer.DefaultExchangeComparator
- All Implemented Interfaces:
Comparator<org.apache.camel.Exchange>
,ExpressionResultComparator
,SequenceElementComparator<org.apache.camel.Exchange>
Compares elements of an
Exchange
sequence by comparing long
values returned by this comparator's
expression
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(org.apache.camel.Exchange o1, org.apache.camel.Exchange o2) boolean
isValid
(org.apache.camel.Exchange exchange) Returns true if theo1
can be used in this comparator.boolean
predecessor
(org.apache.camel.Exchange o1, org.apache.camel.Exchange o2) Returnstrue
ifo1
is an immediate predecessor ofo2
.void
setExpression
(org.apache.camel.Expression expression) Set the expression used for comparingExchange
s.boolean
successor
(org.apache.camel.Exchange o1, org.apache.camel.Exchange o2) Returnstrue
ifo1
is an immediate successor ofo2
.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DefaultExchangeComparator
public DefaultExchangeComparator()
-
-
Method Details
-
setExpression
public void setExpression(org.apache.camel.Expression expression) Description copied from interface:ExpressionResultComparator
Set the expression used for comparingExchange
s.- Specified by:
setExpression
in interfaceExpressionResultComparator
- Parameters:
expression
- the expression
-
predecessor
public boolean predecessor(org.apache.camel.Exchange o1, org.apache.camel.Exchange o2) Description copied from interface:SequenceElementComparator
Returnstrue
ifo1
is an immediate predecessor ofo2
.- Specified by:
predecessor
in interfaceSequenceElementComparator<org.apache.camel.Exchange>
- Parameters:
o1
- a sequence element.o2
- a sequence element.- Returns:
- true if its an immediate predecessor
-
successor
public boolean successor(org.apache.camel.Exchange o1, org.apache.camel.Exchange o2) Description copied from interface:SequenceElementComparator
Returnstrue
ifo1
is an immediate successor ofo2
.- Specified by:
successor
in interfaceSequenceElementComparator<org.apache.camel.Exchange>
- Parameters:
o1
- a sequence element.o2
- a sequence element.- Returns:
- true if it's an immediate successor
-
compare
public int compare(org.apache.camel.Exchange o1, org.apache.camel.Exchange o2) - Specified by:
compare
in interfaceComparator<org.apache.camel.Exchange>
-
isValid
public boolean isValid(org.apache.camel.Exchange exchange) Description copied from interface:SequenceElementComparator
Returns true if theo1
can be used in this comparator.- Specified by:
isValid
in interfaceSequenceElementComparator<org.apache.camel.Exchange>
- Parameters:
exchange
- a sequence element- Returns:
- true if it's usable for this comparator
-
toString
-