![]() | HashCodeBuilder Class |
Namespace: Capgemini.CommonObjectUtils
The HashCodeBuilder type exposes the following members.
Name | Description | |
---|---|---|
![]() | HashCodeBuilder |
Initializes a new instance of the HashCodeBuilder class.
|
![]() | HashCodeBuilder(Int32, Int32) |
Initializes a new instance of the HashCodeBuilder class.
|
Name | Description | |
---|---|---|
![]() | Append(Object) |
Appends the field to the hash code calculation.
|
![]() | AppendT(ICollectionT) |
Appends the values in a collection field to the hash code calculation.
|
![]() | AppendBase |
Appends the result of the base.GetHashCode method.
|
![]() | AppendManyT |
Appends the values in a collection field to the hash code calculation.
|
![]() | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode |
Gets the hash code computed for the fields supplied to this object.
(Overrides ObjectGetHashCode.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
This class allows you to add field to the hash code calculation in a fluent style.
This is a partial port of the Apache Commons HashCodeBuilder utility class.
class Foo { private int field1; private int[] field2; ... public override int GetHashCode() { return new HashCodeBuilder() .Append(field1) .AppendMany(field2) .GetHashCode(); } }