public class LocaleComparator extends Object implements Comparator<Locale>
LocaleComparator compares Locale objects. This Comparator does not
check null, for null check you can decorate it with the
NullCheckComparator.of(Comparator). an example is in the unit test class from
NullCheckComparator.| Constructor and Description |
|---|
LocaleComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Locale o1,
Locale o2) |
static Comparator<Locale> |
of()
Factory method to create a new
LocaleComparator object. |
static Comparator<Locale> |
of(boolean nullIsGreaterThan)
Factory method to create a new
LocaleComparator object. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static Comparator<Locale> of()
LocaleComparator object.LocaleComparator objectpublic static Comparator<Locale> of(boolean nullIsGreaterThan)
LocaleComparator object.nullIsGreaterThan - the flag that specifies if null objects is greater than non null objects.LocaleComparator objectpublic int compare(Locale o1, Locale o2)
compare in interface Comparator<Locale>Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.