public static class GaxEqualityHelpers
Convenience methods to simplify implementing equality comparisons and hash codes.
Namespace
Google.Api.GaxAssembly
Google.Api.Gax.dll
Methods
CombineHashCodes(Int32, Int32)
public static int CombineHashCodes(int hash1, int hash2)
Combines two hash codes.
Parameters | |
---|---|
Name | Description |
hash1 | Int32 The first hash code. |
hash2 | Int32 The second hash code. |
Returns | |
---|---|
Type | Description |
Int32 | The combined hash code. |
CombineHashCodes(Int32, Int32, Int32)
public static int CombineHashCodes(int hash1, int hash2, int hash3)
Combines three hash codes.
Parameters | |
---|---|
Name | Description |
hash1 | Int32 The first hash code. |
hash2 | Int32 The second hash code. |
hash3 | Int32 The third hash code. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
hash1 | Int32 The first hash code. |
hash2 | Int32 The second hash code. |
hash3 | Int32 The third hash code. |
hash4 | Int32 The fourth hash code. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
hash1 | Int32 The first hash code. |
hash2 | Int32 The second hash code. |
hash3 | Int32 The third hash code. |
hash4 | Int32 The fourth hash code. |
hash5 | Int32 The fifth hash code. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
hash1 | Int32 The first hash code. |
hash2 | Int32 The second hash code. |
hash3 | Int32 The third hash code. |
hash4 | Int32 The fourth hash code. |
hash5 | Int32 The fifth hash code. |
hash6 | Int32 The sixth hash code. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
hash1 | Int32 The first hash code. |
hash2 | Int32 The second hash code. |
hash3 | Int32 The third hash code. |
hash4 | Int32 The fourth hash code. |
hash5 | Int32 The fifth hash code. |
hash6 | Int32 The sixth hash code. |
hash7 | Int32 The seventh hash code. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
hash1 | Int32 The first hash code. |
hash2 | Int32 The second hash code. |
hash3 | Int32 The third hash code. |
hash4 | Int32 The fourth hash code. |
hash5 | Int32 The fifth hash code. |
hash6 | Int32 The sixth hash code. |
hash7 | Int32 The seventh hash code. |
hash8 | Int32 The eight hash code. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
list | IReadOnlyList<T> The list to compute a hash code for. May be null. |
Returns | |
---|---|
Type | Description |
Int32 | The computed hash code. |
Type Parameter | |
---|---|
Name | Description |
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 | |
---|---|
Name | Description |
left | IReadOnlyList<T> The left list to compare. May be null. |
right | IReadOnlyList<T> The right list to compare. May be null. |
Returns | |
---|---|
Type | Description |
Boolean | Whether or not the lists are equal |
Type Parameter | |
---|---|
Name | Description |
T |