Package com.norconex.commons.lang
Class EqualsUtil
java.lang.Object
com.norconex.commons.lang.EqualsUtil
Convenience methods related to object equality.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanWhether a source object equals ALL of the target objectsstatic booleanequalsAllIgnoreCase(CharSequence source, CharSequence... targets) Whether a source string equals ALL of the target string.static booleanWhether a source object equals ANY of the target objects.static booleanequalsAnyIgnoreCase(CharSequence source, CharSequence... targets) Whether a source string equals ANY of the target string.static booleanCompares that two maps are equals, regardless of entry orders.static booleanequalsNone(Object source, Object... targets) Whether a source object equals NONE of the target objectsstatic booleanequalsNoneIgnoreCase(String source, CharSequence... targets) Whether a source string equals NONE of the target string.
-
Method Details
-
equalsAny
Whether a source object equals ANY of the target objects.- Parameters:
source- object being tested for equality with targetstargets- one or more objects to be tested with source for equality- Returns:
trueif any of the target objects are equal
-
equalsAnyIgnoreCase
Whether a source string equals ANY of the target string.- Parameters:
source- string being tested for equality with target stringstargets- one or more strings to be tested with source string for equality- Returns:
trueif any of the target strings are equal
-
equalsAll
Whether a source object equals ALL of the target objects- Parameters:
source- object being tested for equality with targetstargets- one or more objects to be tested with source for equality- Returns:
trueif all of the target objects are equal
-
equalsAllIgnoreCase
Whether a source string equals ALL of the target string.- Parameters:
source- string being tested for equality with target stringstargets- one or more strings to be tested with source string for equality- Returns:
trueif all of the target strings are equal
-
equalsNone
Whether a source object equals NONE of the target objects- Parameters:
source- object being tested for equality with targetstargets- one or more objects to be tested with source for equality- Returns:
trueif none of the target objects are equal
-
equalsNoneIgnoreCase
Whether a source string equals NONE of the target string.- Parameters:
source- string being tested for equality with target stringstargets- one or more strings to be tested with source string for equality- Returns:
trueif none of the target strings are equal
-
equalsMap
Compares that two maps are equals, regardless of entry orders. It does so by making sure the two maps are the same size and the first map contains all entries of the other one. Map elements should implementequals.- Parameters:
map1- first mapmap2- second map- Returns:
trueif the two maps are equal- Since:
- 1.14.0
-