org.axonframework.eventhandling
Class EventListenerOrderComparator

java.lang.Object
  extended by org.axonframework.eventhandling.EventListenerOrderComparator
All Implemented Interfaces:
Comparator<EventListener>

public class EventListenerOrderComparator
extends Object
implements Comparator<EventListener>

Comparator implementation that uses an OrderResolver instance to define the expected order of two candidates. When two values have identical order, but the instances are not equal, this Comparator will use the classes hashCode or their Identity HashCode (see System.identityHashCode(Object)) to order the instances.

Since:
2.1
Author:
Allard Buijze

Constructor Summary
EventListenerOrderComparator(OrderResolver orderResolver)
          Creates a comparator using given orderResolver to resolve the "order" value.
 
Method Summary
 int compare(EventListener o1, EventListener 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
 

Constructor Detail

EventListenerOrderComparator

public EventListenerOrderComparator(OrderResolver orderResolver)
Creates a comparator using given orderResolver to resolve the "order" value.

Parameters:
orderResolver - resolver that provides the "order" value of a given EventListener
Method Detail

compare

public int compare(EventListener o1,
                   EventListener o2)
Specified by:
compare in interface Comparator<EventListener>


Copyright © 2010-2016. All Rights Reserved.