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