Class PreferExplicitOrderComparator

java.lang.Object
net.shibboleth.idp.consent.logic.impl.PreferExplicitOrderComparator
All Implemented Interfaces:
Comparator<String>

public class PreferExplicitOrderComparator extends Object implements Comparator<String>
Comparator which prefers to order strings according to the order in which they appear in a list, and which falls back to natural ordering for strings not present in the list. Relies on Guava's Ordering.explicit(List) to compare strings present in the list. Strings not present in the list are treated as greater than strings present in the list and are compared according to their natural ordering. Does not support comparing null values. Is not serializable, and such should not be used as part of a TreeMap, for example, which is serialized.