commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1565915 - in /commons/proper/lang/trunk/src: changes/changes.xml main/java/org/apache/commons/lang3/mutable/MutableBoolean.java test/java/org/apache/commons/lang3/mutable/MutableBooleanTest.java
Date Sat, 08 Feb 2014 04:35:18 GMT
Author: ggregory
Date: Sat Feb  8 04:35:17 2014
New Revision: 1565915

URL: http://svn.apache.org/r1565915
Log:
<action issue="LANG-970" type="add" dev="ggregory">Add APIs MutableBoolean setTrue()
and setFalse()</action>

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableBooleanTest.java

Modified: commons/proper/lang/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/changes/changes.xml?rev=1565915&r1=1565914&r2=1565915&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/lang/trunk/src/changes/changes.xml [utf-8] Sat Feb  8 04:35:17 2014
@@ -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>

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java?rev=1565915&r1=1565914&r2=1565915&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java
Sat Feb  8 04:35:17 2014
@@ -89,6 +89,24 @@ public class MutableBoolean implements M
     }
 
     /**
+     * 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.
      * 
      * @param value  the value to set, not null

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableBooleanTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableBooleanTest.java?rev=1565915&r1=1565914&r2=1565915&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableBooleanTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/mutable/MutableBooleanTest.java
Sat Feb  8 04:35:17 2014
@@ -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)



Mime
View raw message