Package com.norconex.commons.lang
Class EqualsUtil
- java.lang.Object
-
- com.norconex.commons.lang.EqualsUtil
-
public final class EqualsUtil extends Object
Convenience methods related to object equality.- Author:
- Pascal Essiembre
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanequalsAll(Object source, Object... targets)Whether 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 booleanequalsAny(Object source, Object... targets)Whether 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 booleanequalsMap(Map<?,?> map1, Map<?,?> map2)Compares 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, String... targets)Whether a source string equals NONE of the target string.
-
-
-
Method Detail
-
equalsAny
public static boolean equalsAny(Object source, Object... targets)
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
public static boolean equalsAnyIgnoreCase(CharSequence source, CharSequence... targets)
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
public static boolean equalsAll(Object source, Object... targets)
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
public static boolean equalsAllIgnoreCase(CharSequence source, CharSequence... targets)
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
public static boolean equalsNone(Object source, Object... targets)
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
public static boolean equalsNoneIgnoreCase(String source, String... targets)
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
public static boolean equalsMap(Map<?,?> map1, Map<?,?> map2)
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
-
-