Class GaxEqualityHelpers (4.2.0)

public static class GaxEqualityHelpers

Convenience methods to simplify implementing equality comparisons and hash codes.

Inheritance

Object > GaxEqualityHelpers

Namespace

Google.Api.Gax

Assembly

Google.Api.Gax.dll

Methods

CombineHashCodes(Int32, Int32)

public static int CombineHashCodes(int hash1, int hash2)

Combines two hash codes.

Parameters
NameDescription
hash1Int32

The first hash code.

hash2Int32

The second hash code.

Returns
TypeDescription
Int32

The combined hash code.

CombineHashCodes(Int32, Int32, Int32)

public static int CombineHashCodes(int hash1, int hash2, int hash3)

Combines three hash codes.

Parameters
NameDescription
hash1Int32

The first hash code.

hash2Int32

The second hash code.

hash3Int32

The third hash code.

Returns
TypeDescription
Int32

The combined hash code.

CombineHashCodes(Int32, Int32, Int32, Int32)

public static int CombineHashCodes(int hash1, int hash2, int hash3, int hash4)

Combines four hash codes.

Parameters
NameDescription
hash1Int32

The first hash code.

hash2Int32

The second hash code.

hash3Int32

The third hash code.

hash4Int32

The fourth hash code.

Returns
TypeDescription
Int32

The combined hash code.

CombineHashCodes(Int32, Int32, Int32, Int32, Int32)

public static int CombineHashCodes(int hash1, int hash2, int hash3, int hash4, int hash5)

Combines five hash codes.

Parameters
NameDescription
hash1Int32

The first hash code.

hash2Int32

The second hash code.

hash3Int32

The third hash code.

hash4Int32

The fourth hash code.

hash5Int32

The fifth hash code.

Returns
TypeDescription
Int32

The combined hash code.

CombineHashCodes(Int32, Int32, Int32, Int32, Int32, Int32)

public static int CombineHashCodes(int hash1, int hash2, int hash3, int hash4, int hash5, int hash6)

Combines six hash codes.

Parameters
NameDescription
hash1Int32

The first hash code.

hash2Int32

The second hash code.

hash3Int32

The third hash code.

hash4Int32

The fourth hash code.

hash5Int32

The fifth hash code.

hash6Int32

The sixth hash code.

Returns
TypeDescription
Int32

The combined hash code.

CombineHashCodes(Int32, Int32, Int32, Int32, Int32, Int32, Int32)

public static int CombineHashCodes(int hash1, int hash2, int hash3, int hash4, int hash5, int hash6, int hash7)

Combines seven hash codes.

Parameters
NameDescription
hash1Int32

The first hash code.

hash2Int32

The second hash code.

hash3Int32

The third hash code.

hash4Int32

The fourth hash code.

hash5Int32

The fifth hash code.

hash6Int32

The sixth hash code.

hash7Int32

The seventh hash code.

Returns
TypeDescription
Int32

The combined hash code.

CombineHashCodes(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

public static int CombineHashCodes(int hash1, int hash2, int hash3, int hash4, int hash5, int hash6, int hash7, int hash8)

Combines eight hash codes.

Parameters
NameDescription
hash1Int32

The first hash code.

hash2Int32

The second hash code.

hash3Int32

The third hash code.

hash4Int32

The fourth hash code.

hash5Int32

The fifth hash code.

hash6Int32

The sixth hash code.

hash7Int32

The seventh hash code.

hash8Int32

The eight hash code.

Returns
TypeDescription
Int32

The combined hash code.

GetListHashCode<T>(IReadOnlyList<T>)

public static int GetListHashCode<T>(IReadOnlyList<T> list)
    where T : IEquatable<T>

Computes an ordering-sensitive hash code for a list, using the default equality comparer for the type.

Parameter
NameDescription
listIReadOnlyList<T>

The list to compute a hash code for. May be null.

Returns
TypeDescription
Int32

The computed hash code.

Type Parameter
NameDescription
T

ListsEqual<T>(IReadOnlyList<T>, IReadOnlyList<T>)

public static bool ListsEqual<T>(IReadOnlyList<T> left, IReadOnlyList<T> right)
    where T : IEquatable<T>

Checks if two lists are equal, in an ordering-sensitive manner, using the default equality comparer for the type.

Parameters
NameDescription
leftIReadOnlyList<T>

The left list to compare. May be null.

rightIReadOnlyList<T>

The right list to compare. May be null.

Returns
TypeDescription
Boolean

Whether or not the lists are equal

Type Parameter
NameDescription
T