Class ResourceReader.ResourceReaderComparator
- java.lang.Object
-
- org.jboss.resteasy.reactive.common.model.ResourceReader.ResourceReaderComparator
-
- All Implemented Interfaces:
Comparator<ResourceReader>
- Enclosing class:
- ResourceReader
public static class ResourceReader.ResourceReaderComparator extends Object implements Comparator<ResourceReader>
The comparison for now is simple: 1) Application provided writers come first 2) Readers with lower priority come first (same as reader interceptors) 3) Then the more specific the media type, the higher the priority 4) Finally we compare the number of media types The spec doesn't seem to mention this sorting being explicitly needed, but there are tests in the TCK that only pass reliably if the Readers are sorted like this
-
-
Constructor Summary
Constructors Constructor Description ResourceReaderComparator(List<javax.ws.rs.core.MediaType> produces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(ResourceReader o1, ResourceReader 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
-
ResourceReaderComparator
public ResourceReaderComparator(List<javax.ws.rs.core.MediaType> produces)
-
-
Method Detail
-
compare
public int compare(ResourceReader o1, ResourceReader o2)
- Specified by:
compare
in interfaceComparator<ResourceReader>
-
-