commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1091241 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/ main/java/org/apache/commons/lang3/builder/ test/java/org/apache/commons/lang3/
Date Mon, 11 Apr 2011 22:39:35 GMT
Author: ggregory
Date: Mon Apr 11 22:39:35 2011
New Revision: 1091241

URL: http://svn.apache.org/viewvc?rev=1091241&view=rev
Log:
Rename getRightElement() to getRight(). Rename getLeftElement() to getLeft().

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ImmutablePair.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/MutablePair.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Pair.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ImmutablePairTest.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/MutablePairTest.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ImmutablePair.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ImmutablePair.java?rev=1091241&r1=1091240&r2=1091241&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ImmutablePair.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ImmutablePair.java Mon
Apr 11 22:39:35 2011
@@ -75,7 +75,7 @@ public class ImmutablePair<L, R> extends
      * {@inheritDoc}
      */
     @Override
-    public L getLeftElement() {
+    public L getLeft() {
         return left;
     }
 
@@ -83,7 +83,7 @@ public class ImmutablePair<L, R> extends
      * {@inheritDoc}
      */
     @Override
-    public R getRightElement() {
+    public R getRight() {
         return right;
     }
 

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/MutablePair.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/MutablePair.java?rev=1091241&r1=1091240&r2=1091241&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/MutablePair.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/MutablePair.java Mon
Apr 11 22:39:35 2011
@@ -77,7 +77,7 @@ public class MutablePair<L, R> extends P
      * {@inheritDoc}
      */
     @Override
-    public L getLeftElement() {
+    public L getLeft() {
         return left;
     }
 
@@ -94,7 +94,7 @@ public class MutablePair<L, R> extends P
      * {@inheritDoc}
      */
     @Override
-    public R getRightElement() {
+    public R getRight() {
         return right;
     }
 
@@ -115,7 +115,7 @@ public class MutablePair<L, R> extends P
      * @return the old value for the right element
      */
     public R setValue(R value) {
-        R result = getRightElement();
+        R result = getRight();
         setRightElement(value);
         return result;
     }

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Pair.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Pair.java?rev=1091241&r1=1091240&r2=1091241&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Pair.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Pair.java Mon Apr 11
22:39:35 2011
@@ -70,7 +70,7 @@ public abstract class Pair<L, R> impleme
      * 
      * @return the left element, may be null
      */
-    public abstract L getLeftElement();
+    public abstract L getLeft();
 
     /**
      * <p>Gets the right element from this pair.</p>
@@ -79,7 +79,7 @@ public abstract class Pair<L, R> impleme
      * 
      * @return the right element, may be null
      */
-    public abstract R getRightElement();
+    public abstract R getRight();
 
     /**
      * <p>Gets the key from this pair.</p>
@@ -90,7 +90,7 @@ public abstract class Pair<L, R> impleme
      * @return the left element as the key, may be null
      */
     public final L getKey() {
-        return getLeftElement();
+        return getLeft();
     }
 
     /**
@@ -102,7 +102,7 @@ public abstract class Pair<L, R> impleme
      * @return the right element as the value, may be null
      */
     public R getValue() {
-        return getRightElement();
+        return getRight();
     }
 
     //-----------------------------------------------------------------------
@@ -114,8 +114,8 @@ public abstract class Pair<L, R> impleme
      * @return negative if this is less, zero if equal, positive if greater
      */
     public int compareTo(Pair<L, R> other) {
-      return new CompareToBuilder().append(getLeftElement(), other.getLeftElement())
-              .append(getRightElement(), other.getRightElement()).toComparison();
+      return new CompareToBuilder().append(getLeft(), other.getLeft())
+              .append(getRight(), other.getRight()).toComparison();
     }
 
     /**
@@ -174,6 +174,6 @@ public abstract class Pair<L, R> impleme
      * @return a string for this object
      */
     public String toString(String format) {
-        return String.format(format, getClass().getSimpleName(), getLeftElement(), getRightElement());
+        return String.format(format, getClass().getSimpleName(), getLeft(), getRight());
     }
 }

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java?rev=1091241&r1=1091240&r2=1091241&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java
Mon Apr 11 22:39:35 2011
@@ -153,7 +153,7 @@ public class EqualsBuilder implements Bu
     static boolean isRegistered(Object lhs, Object rhs) {
         Set<Pair<IDKey, IDKey>> registry = getRegistry();
         Pair<IDKey, IDKey> pair = getRegisterPair(lhs, rhs);
-        Pair<IDKey, IDKey> swappedPair = Pair.of(pair.getLeftElement(), pair.getRightElement());
+        Pair<IDKey, IDKey> swappedPair = Pair.of(pair.getLeft(), pair.getRight());
 
         return registry != null
                 && (registry.contains(pair) || registry.contains(swappedPair));

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ImmutablePairTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ImmutablePairTest.java?rev=1091241&r1=1091240&r2=1091241&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ImmutablePairTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ImmutablePairTest.java
Mon Apr 11 22:39:35 2011
@@ -38,28 +38,28 @@ public class ImmutablePairTest {
     public void testBasic() throws Exception {
         ImmutablePair<Integer, String> pair = new ImmutablePair<Integer, String>(0,
"foo");
         assertEquals(0, pair.left.intValue());
-        assertEquals(0, pair.getLeftElement().intValue());
+        assertEquals(0, pair.getLeft().intValue());
         assertEquals("foo", pair.right);
-        assertEquals("foo", pair.getRightElement());
+        assertEquals("foo", pair.getRight());
         ImmutablePair<Object, String> pair2 = new ImmutablePair<Object, String>(null,
"bar");
         assertNull(pair2.left);
-        assertNull(pair2.getLeftElement());
+        assertNull(pair2.getLeft());
         assertEquals("bar", pair2.right);
-        assertEquals("bar", pair2.getRightElement());
+        assertEquals("bar", pair2.getRight());
     }
 
     @Test
     public void testPairOf() throws Exception {
         ImmutablePair<Integer, String> pair = ImmutablePair.of(0, "foo");
         assertEquals(0, pair.left.intValue());
-        assertEquals(0, pair.getLeftElement().intValue());
+        assertEquals(0, pair.getLeft().intValue());
         assertEquals("foo", pair.right);
-        assertEquals("foo", pair.getRightElement());
+        assertEquals("foo", pair.getRight());
         ImmutablePair<Object, String> pair2 = ImmutablePair.of(null, "bar");
         assertNull(pair2.left);
-        assertNull(pair2.getLeftElement());
+        assertNull(pair2.getLeft());
         assertEquals("bar", pair2.right);
-        assertEquals("bar", pair2.getRightElement());
+        assertEquals("bar", pair2.getRight());
     }
 
     @Test

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/MutablePairTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/MutablePairTest.java?rev=1091241&r1=1091240&r2=1091241&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/MutablePairTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/MutablePairTest.java
Mon Apr 11 22:39:35 2011
@@ -37,18 +37,18 @@ public class MutablePairTest {
     @Test
     public void testBasic() throws Exception {
         MutablePair<Integer, String> pair = new MutablePair<Integer, String>(0,
"foo");
-        assertEquals(0, pair.getLeftElement().intValue());
-        assertEquals("foo", pair.getRightElement());
+        assertEquals(0, pair.getLeft().intValue());
+        assertEquals("foo", pair.getRight());
         MutablePair<Object, String> pair2 = new MutablePair<Object, String>(null,
"bar");
-        assertNull(pair2.getLeftElement());
-        assertEquals("bar", pair2.getRightElement());
+        assertNull(pair2.getLeft());
+        assertEquals("bar", pair2.getRight());
     }
 
     @Test
     public void testDefault() throws Exception {
         MutablePair<Integer, String> pair = new MutablePair<Integer, String>();
-        assertNull(pair.getLeftElement());
-        assertNull(pair.getRightElement());
+        assertNull(pair.getLeft());
+        assertNull(pair.getRight());
     }
     
     @Test
@@ -56,18 +56,18 @@ public class MutablePairTest {
         MutablePair<Integer, String> pair = new MutablePair<Integer, String>(0,
"foo");
         pair.setLeftElement(42);
         pair.setRightElement("bar");
-        assertEquals(42, pair.getLeftElement().intValue());
-        assertEquals("bar", pair.getRightElement());
+        assertEquals(42, pair.getLeft().intValue());
+        assertEquals("bar", pair.getRight());
     }
 
     @Test
     public void testPairOf() throws Exception {
         MutablePair<Integer, String> pair = MutablePair.of(0, "foo");
-        assertEquals(0, pair.getLeftElement().intValue());
-        assertEquals("foo", pair.getRightElement());
+        assertEquals(0, pair.getLeft().intValue());
+        assertEquals("foo", pair.getRight());
         MutablePair<Object, String> pair2 = MutablePair.of(null, "bar");
-        assertNull(pair2.getLeftElement());
-        assertEquals("bar", pair2.getRightElement());
+        assertNull(pair2.getLeft());
+        assertEquals("bar", pair2.getRight());
     }
 
     @Test



Mime
View raw message