<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:
parent
2d6fef59e6
commit
4b718f6e5a
|
@ -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>
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue