public static class GaxEqualityHelpersConvenience 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 |
intThe first hash code. |
hash2 |
intThe 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 |
intThe first hash code. |
hash2 |
intThe second hash code. |
hash3 |
intThe 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 |
intThe first hash code. |
hash2 |
intThe second hash code. |
hash3 |
intThe third hash code. |
hash4 |
intThe 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 |
intThe first hash code. |
hash2 |
intThe second hash code. |
hash3 |
intThe third hash code. |
hash4 |
intThe fourth hash code. |
hash5 |
intThe 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 |
intThe first hash code. |
hash2 |
intThe second hash code. |
hash3 |
intThe third hash code. |
hash4 |
intThe fourth hash code. |
hash5 |
intThe fifth hash code. |
hash6 |
intThe 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 |
intThe first hash code. |
hash2 |
intThe second hash code. |
hash3 |
intThe third hash code. |
hash4 |
intThe fourth hash code. |
hash5 |
intThe fifth hash code. |
hash6 |
intThe sixth hash code. |
hash7 |
intThe 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 |
intThe first hash code. |
hash2 |
intThe second hash code. |
hash3 |
intThe third hash code. |
hash4 |
intThe fourth hash code. |
hash5 |
intThe fifth hash code. |
hash6 |
intThe sixth hash code. |
hash7 |
intThe seventh hash code. |
hash8 |
intThe 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 |
IReadOnlyListThe 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 |
IReadOnlyListThe left list to compare. May be null. |
right |
IReadOnlyListThe right list to compare. May be null. |
| Returns | |
|---|---|
| Type | Description |
bool |
Whether or not the lists are equal |
| Type Parameter | |
|---|---|
| Name | Description |
T |
|