<action issue="LANG-970" type="add" dev="ggregory">Add APIs MutableBoolean setTrue() and setFalse()</action>

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1565915 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2014-02-08 04:35:17 +00:00
parent 2d6fef59e6
commit 4b718f6e5a
3 changed files with 25 additions and 0 deletions

View File

@ -22,6 +22,7 @@
<body>
<release version="3.3" date="TBA" description="Bugfix and Feature release">
<action issue="LANG-970" type="add" dev="ggregory">Add APIs MutableBoolean setTrue() and setFalse()</action>
<action issue="LANG-946" type="fix" dev="britter">ConstantInitializerTest fails when building with IBM JDK 7</action>
<action issue="LANG-962" type="add" dev="ggregory">Add SerializationUtils.roundtrip(T extends Serializable) to serialize then deserialize</action>
<action issue="LANG-961" type="update" dev="ggregory">org.apache.commons.lang3.reflect.FieldUtils.removeFinalModifier(Field) does not clean up after itself</action>

View File

@ -88,6 +88,24 @@ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparabl
this.value = value;
}
/**
* Sets the value to true.
*
* @since 3.3
*/
public void setFalse() {
this.value = false;
}
/**
* Sets the value to false.
*
* @since 3.3
*/
public void setTrue() {
this.value = true;
}
/**
* Sets the value from any Boolean instance.
*

View File

@ -105,6 +105,12 @@ public class MutableBooleanTest {
mutBool.setValue(true);
assertTrue(mutBool.booleanValue());
mutBool.setFalse();
assertFalse(mutBool.booleanValue());
mutBool.setTrue();
assertTrue(mutBool.booleanValue());
}
@Test(expected=NullPointerException.class)