Class GaxEqualityHelpers (4.3.1)

public static class GaxEqualityHelpers

Convenience methods to simplify implementing equality comparisons and hash codes.

Inheritance

object > GaxEqualityHelpers

Namespace

GoogleGoogle.ApiGax

Assembly

Google.Api.Gax.dll

Methods

CombineHashCodes(int, int)

public static int CombineHashCodes(int hash1, int hash2)

Combines two hash codes.

Parameters
NameDescription
hash1int

The first hash code.

hash2int

The second hash code.

Returns
TypeDescription
int

The combined hash code.

CombineHashCodes(int, int, int)

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

Combines three hash codes.

Parameters
NameDescription
hash1int

The first hash code.

hash2int

The second hash code.

hash3int

The third hash code.

Returns
TypeDescription
int

The combined hash code.

CombineHashCodes(int, int, int, int)

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

Combines four hash codes.

Parameters
NameDescription
hash1int

The first hash code.

hash2int

The second hash code.

hash3int

The third hash code.

hash4int

The fourth hash code.

Returns
TypeDescription
int

The combined hash code.

CombineHashCodes(int, int, int, int, int)

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

Combines five hash codes.

Parameters
NameDescription
hash1int

The first hash code.

hash2int

The second hash code.

hash3int

The third hash code.

hash4int

The fourth hash code.

hash5int

The fifth hash code.

Returns
TypeDescription
int

The combined hash code.

CombineHashCodes(int, int, int, int, int, int)

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

Combines six hash codes.

Parameters
NameDescription
hash1int

The first hash code.

hash2int

The second hash code.

hash3int

The third hash code.

hash4int

The fourth hash code.

hash5int

The fifth hash code.

hash6int

The sixth hash code.

Returns
TypeDescription
int

The combined hash code.

CombineHashCodes(int, int, int, int, int, int, int)

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

Combines seven hash codes.

Parameters
NameDescription
hash1int

The first hash code.

hash2int

The second hash code.

hash3int

The third hash code.

hash4int

The fourth hash code.

hash5int

The fifth hash code.

hash6int

The sixth hash code.

hash7int

The seventh hash code.

Returns
TypeDescription
int

The combined hash code.

CombineHashCodes(int, int, int, int, int, int, int, int)

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
hash1int

The first hash code.

hash2int

The second hash code.

hash3int

The third hash code.

hash4int

The fourth hash code.

hash5int

The fifth hash code.

hash6int

The sixth hash code.

hash7int

The seventh hash code.

hash8int

The eight hash code.

Returns
TypeDescription
int

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

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

Returns
TypeDescription
int

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

The left list to compare. May be null.

rightIReadOnlyList

The right list to compare. May be null.

Returns
TypeDescription
bool

Whether or not the lists are equal

Type Parameter
NameDescription
T