public class EqualityUtil
extends java.lang.Object
Constructor and Description |
---|
EqualityUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(boolean[] a,
boolean[] b) |
static boolean |
equals(byte[] a,
byte[] b) |
static boolean |
equals(char[] a,
char[] b) |
static boolean |
equals(double[] a,
double[] b) |
static boolean |
equals(float[] a,
float[] b) |
static boolean |
equals(int[] a,
int[] b) |
static boolean |
equals(long[] a,
long[] b) |
static boolean |
equals(java.lang.Object[] a,
java.lang.Object[] b) |
static boolean |
equals(java.lang.Object a,
java.lang.Object b) |
static boolean |
equals(short[] a,
short[] b) |
static boolean |
equals(java.lang.String a,
java.lang.String b)
Compare two String objects.
|
public static boolean equals(boolean[] a, boolean[] b)
public static boolean equals(byte[] a, byte[] b)
public static boolean equals(char[] a, char[] b)
public static boolean equals(double[] a, double[] b)
public static boolean equals(float[] a, float[] b)
public static boolean equals(int[] a, int[] b)
public static boolean equals(long[] a, long[] b)
public static boolean equals(java.lang.Object a, java.lang.Object b)
public static boolean equals(java.lang.Object[] a, java.lang.Object[] b)
public static boolean equals(short[] a, short[] b)
public static boolean equals(java.lang.String a, java.lang.String b)
It is common in XML to alter whitespace during the encoding process. For this reason it is a best practice to ignore whitespace when comparing XML String objects. For strict String equality cast the String objects into Object objects.
boolean flag = EqualityUtil.equals((Object)a, (Object)b);
a
- First String
b
- Second String
true
if equal; false
otherwise.