Top Description Fields Constructors Methods
org.apache.hc.core5.util

public final Class LangUtils

extends Object
Class Inheritance
Imports
java.util.Arrays, .Objects

A set of utility methods to help produce consistent equals and hashCode methods.
Since
4.0

Field Summary

Modifier and TypeField and Description
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
private
LangUtils()

Disabled default constructor.

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the objects are equal or both null
equals
(final Object
first object to compare, may be null
obj1
,
final Object
second object to compare, may be null
obj2
)

Deprecated Use Objects#equals(Object).
Check if two objects are equal.
public static boolean

Returns:

true if the arrays are equal or both null
equals
(final Object[]
first array to compare, may be null
a1
,
final Object[]
second array to compare, may be null
a2
)

Deprecated Use Arrays#equals(Object).
Check if two object arrays are equal.
public static int
hashCode(final int seed, final int hashcode)

public static int
hashCode(final int seed, final boolean b)

public static int
hashCode(final int seed, final Object obj)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HASH_OFFSETback to summary
public static final int HASH_OFFSET
HASH_SEEDback to summary
public static final int HASH_SEED

Constructor Detail

LangUtilsback to summary
private LangUtils()

Disabled default constructor.

Method Detail

equalsback to summary
public static boolean equals(final Object obj1, final Object obj2)

Deprecated

Use Objects#equals(Object).

Check if two objects are equal.

Parameters
obj1:Object

first object to compare, may be null

obj2:Object

second object to compare, may be null

Returns:boolean

true if the objects are equal or both null

Annotations
@Deprecated
equalsback to summary
public static boolean equals(final Object[] a1, final Object[] a2)

Deprecated

Use Arrays#equals(Object).

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 false if any comparisons fail.
  • Return true
Parameters
a1:Object[]

first array to compare, may be null

a2:Object[]

second array to compare, may be null

Returns:boolean

true if the arrays are equal or both null

Annotations
@Deprecated
hashCodeback to summary
public static int hashCode(final int seed, final int hashcode)
hashCodeback to summary
public static int hashCode(final int seed, final boolean b)
hashCodeback to summary
public static int hashCode(final int seed, final Object obj)