Package org.apache.http.util
Class LangUtils
- java.lang.Object
-
- org.apache.http.util.LangUtils
-
public final class LangUtils extends java.lang.ObjectA set of utility methods to help produce consistentequalsandhashCodemethods.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description static intHASH_OFFSETstatic intHASH_SEED
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanequals(java.lang.Object[] a1, java.lang.Object[] a2)Check if two object arrays are equal.static booleanequals(java.lang.Object obj1, java.lang.Object obj2)Check if two objects are equal.static inthashCode(int seed, boolean b)static inthashCode(int seed, int hashcode)static inthashCode(int seed, java.lang.Object obj)
-
-
-
Field Detail
-
HASH_SEED
public static final int HASH_SEED
- See Also:
- Constant Field Values
-
HASH_OFFSET
public static final int HASH_OFFSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
hashCode
public static int hashCode(int seed, int hashcode)
-
hashCode
public static int hashCode(int seed, boolean b)
-
hashCode
public static int hashCode(int seed, java.lang.Object obj)
-
equals
public static boolean equals(java.lang.Object obj1, java.lang.Object obj2)Check if two objects are equal.- Parameters:
obj1- first object to compare, may benullobj2- second object to compare, may benull- Returns:
trueif the objects are equal or both null
-
equals
public static boolean equals(java.lang.Object[] a1, java.lang.Object[] a2)Check if two object arrays are equal.- If both parameters are null, return
true - If one parameter is null, return
false - If the array lengths are different, return
false - Compare array elements using .equals(); return
falseif any comparisons fail. - Return
true
- Parameters:
a1- first array to compare, may benulla2- second array to compare, may benull- Returns:
trueif the arrays are equal or both null
- If both parameters are null, return
-
-