Adding a reset() method to EqualsBuilder. LANG-466
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@890196 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2851806365
commit
0c6c23076f
|
@ -840,4 +840,11 @@ public class EqualsBuilder {
|
|||
protected void setEquals(boolean isEquals) {
|
||||
this.isEquals = isEquals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the EqualsBuilder so you can use the same object again
|
||||
*/
|
||||
public void reset() {
|
||||
this.isEquals = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -392,6 +392,15 @@ public class EqualsBuilderTest extends TestCase {
|
|||
assertFalse(equalsBuilder.isEquals());
|
||||
}
|
||||
|
||||
public void testReset() {
|
||||
EqualsBuilder equalsBuilder = new EqualsBuilder();
|
||||
assertTrue(equalsBuilder.isEquals());
|
||||
equalsBuilder.setEquals(false);
|
||||
assertFalse(equalsBuilder.isEquals());
|
||||
equalsBuilder.reset();
|
||||
assertTrue(equalsBuilder.isEquals());
|
||||
}
|
||||
|
||||
public void testBoolean() {
|
||||
boolean o1 = true;
|
||||
boolean o2 = false;
|
||||
|
|
Loading…
Reference in New Issue