rename MutablePair setters for bean compatibility

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1124337 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2011-05-18 17:01:47 +00:00
parent 7138e054f3
commit facd90be6f
2 changed files with 5 additions and 5 deletions

View File

@ -86,7 +86,7 @@ public class MutablePair<L, R> extends Pair<L, R> {
*
* @param left the new value of the left element, may be null
*/
public void setLeftElement(L left) {
public void setLeft(L left) {
this.left = left;
}
@ -103,7 +103,7 @@ public class MutablePair<L, R> extends Pair<L, R> {
*
* @param right the value of the right element
*/
public void setRightElement(R right) {
public void setRight(R right) {
this.right = right;
}
@ -116,7 +116,7 @@ public class MutablePair<L, R> extends Pair<L, R> {
*/
public R setValue(R value) {
R result = getRight();
setRightElement(value);
setRight(value);
return result;
}

View File

@ -54,8 +54,8 @@ public class MutablePairTest {
@Test
public void testMutate() throws Exception {
MutablePair<Integer, String> pair = new MutablePair<Integer, String>(0, "foo");
pair.setLeftElement(42);
pair.setRightElement("bar");
pair.setLeft(42);
pair.setRight("bar");
assertEquals(42, pair.getLeft().intValue());
assertEquals("bar", pair.getRight());
}