Class CountryComparator
- All Implemented Interfaces:
Serializable
,Comparator<Country>
A Comparator for Country beans.
- Since:
- 3.2
- Version:
- 7.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsFields inherited from class org.deltava.comparators.AbstractComparator
_comparisonType, _typeNames
-
Constructor Summary
ConstructorsConstructorDescriptionCountryComparator
(int comparisonType) Creates a new CountryComparator with a given comparison type.CountryComparator
(String comparisonType) Creates a new CountryComparator with a given comparison type. -
Method Summary
Modifier and TypeMethodDescriptionint
compareImpl
(Country c1, Country c2) Compares two countries by the designated criteria.Methods inherited from class org.deltava.comparators.AbstractComparator
compare, getComparisonType, getTypeNames, setComparisonType, setComparisonType
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
-
Field Details
-
CODE
public static final int CODE- See Also:
-
NAME
public static final int NAME- See Also:
-
-
Constructor Details
-
CountryComparator
public CountryComparator(int comparisonType) Creates a new CountryComparator with a given comparison type.- Parameters:
comparisonType
- The criteria by which to compare- Throws:
IllegalArgumentException
- if the type is invalid- See Also:
-
CountryComparator
Creates a new CountryComparator with a given comparison type.- Parameters:
comparisonType
- The criteria type name by which to compare- Throws:
IllegalArgumentException
- if the type name is invalid- See Also:
-
-
Method Details
-
compareImpl
Compares two countries by the designated criteria.- Specified by:
compareImpl
in classAbstractComparator<Country>
- Parameters:
c1
- The first object to comparec2
- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- See Also:
-