@StableApi public class EqualsHelper extends Object
equals functionality| Modifier and Type | Class and Description |
|---|---|
static class |
EqualsHelper.MapValueComparison
Enumeration for results returned by
map comparisons. |
| Constructor and Description |
|---|
EqualsHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
binaryStreamEquals(InputStream left,
InputStream right)
Performs a byte-level comparison between two streams.
|
static <K,V> Map<K,EqualsHelper.MapValueComparison> |
getMapComparison(Map<K,V> left,
Map<K,V> right)
Compare two maps.
|
static String |
getMapDifferenceReport(Map<?,?> actual,
Map<?,?> expected)
Compare two maps and generate a difference report between the actual and expected values.
|
static boolean |
nullSafeEquals(Object left,
Object right)
Performs an equality check
left.equals(right) after checking for null values |
static boolean |
nullSafeEquals(String left,
String right,
boolean ignoreCase)
Performs an case-sensitive or case-insensitive equality check after checking for null values
|
public static boolean nullSafeEquals(Object left, Object right)
left.equals(right) after checking for null valuesleft - the Object appearing in the left side of an equals statementright - the Object appearing in the right side of an equals statementpublic static boolean nullSafeEquals(String left, String right, boolean ignoreCase)
ignoreCase - true to ignore casepublic static boolean binaryStreamEquals(InputStream left, InputStream right) throws IOException
left - the left stream. This is closed at the end of the operation.right - an right stream. This is closed at the end of the operation.IOExceptionpublic static String getMapDifferenceReport(Map<?,?> actual, Map<?,?> expected)
actual - the map in handexpected - the map expectedpublic static <K,V> Map<K,EqualsHelper.MapValueComparison> getMapComparison(Map<K,V> left, Map<K,V> right)
K - the map key typeV - the map value typeleft - the left side of the comparisonright - the right side of the comparisonCopyright © 2018 Alfresco Software. All rights reserved.