![]() | EqualsBuilder Class |
Namespace: Capgemini.CommonObjectUtils
The EqualsBuilder type exposes the following members.
Name | Description | |
---|---|---|
![]() | EqualsBuilder | Initializes a new instance of the EqualsBuilder class |
Name | Description | |
---|---|---|
![]() | AppendT(T, T) |
Appends two objects that implement the IEquatable interface to the list of values to compare.
|
![]() | AppendT(T, T, IEqualityComparerT) |
Appends two objects to the list of values to compare and compares them using a supplied comparer.
|
![]() | AppendT(T, T, FuncT, T, Boolean) |
Appends two objects to the list values to compare and compares them using a supplied comparison function.
|
![]() | AppendBase |
Appends the result of base.Equals.
|
![]() | AppendManyT(IEnumerableT, IEnumerableT) |
Appends two enumerable objects that contain the same (IEquatable) type to the list of values
to compare.
|
![]() | AppendManyT(IEnumerableT, IEnumerableT, IEqualityComparerT) |
Appends two enumerable objects that contain the same type to the list of values to compare.
|
![]() | AppendManyT(IEnumerableT, IEnumerableT, FuncT, T, Boolean) |
Appends two enumerable objects that contain the same type to the list of values to compare.
|
![]() | 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 | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Reset |
Resets the EqualsBuilder so that it can be used again.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
This class allows you to compare multiple fields in your class in a fluent style.
This is a partial port of the Apache Commons EqualsBuilder class.
class Foo { private int field1; private int[] field2; ... public override bool Equals(object obj) { ... MyClass other = obj as MyClass; return new EqualsBuilder() .Append(field1, other.field1) .AppendMany(field2, other.field2) .IsEquals; } }