From 8256dbef70e46559c7789be92c0a74dcf62d37e8 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Tue, 12 Apr 2011 18:29:49 +0000 Subject: [PATCH] Refactor all 3 three Pair classes from o.a.c.l to o.a.c.l.tuple. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1091531 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang3/builder/EqualsBuilder.java | 2 +- .../lang3/{ => tuple}/ImmutablePair.java | 2 +- .../lang3/{ => tuple}/MutablePair.java | 2 +- .../commons/lang3/{ => tuple}/Pair.java | 3 ++- .../apache/commons/lang3/tuple/package.html | 22 +++++++++++++++++++ .../lang3/{ => tuple}/ImmutablePairTest.java | 4 ++-- .../lang3/{ => tuple}/MutablePairTest.java | 4 ++-- .../commons/lang3/{ => tuple}/PairTest.java | 2 +- 8 files changed, 32 insertions(+), 9 deletions(-) rename src/main/java/org/apache/commons/lang3/{ => tuple}/ImmutablePair.java (98%) rename src/main/java/org/apache/commons/lang3/{ => tuple}/MutablePair.java (98%) rename src/main/java/org/apache/commons/lang3/{ => tuple}/Pair.java (98%) create mode 100644 src/main/java/org/apache/commons/lang3/tuple/package.html rename src/test/java/org/apache/commons/lang3/{ => tuple}/ImmutablePairTest.java (99%) rename src/test/java/org/apache/commons/lang3/{ => tuple}/MutablePairTest.java (99%) rename src/test/java/org/apache/commons/lang3/{ => tuple}/PairTest.java (99%) diff --git a/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java b/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java index 2a9fe77b7..33eee397c 100644 --- a/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java @@ -24,7 +24,7 @@ import java.util.HashSet; import java.util.Set; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.Pair; +import org.apache.commons.lang3.tuple.Pair; /** *

Assists in implementing {@link Object#equals(Object)} methods.

diff --git a/src/main/java/org/apache/commons/lang3/ImmutablePair.java b/src/main/java/org/apache/commons/lang3/tuple/ImmutablePair.java similarity index 98% rename from src/main/java/org/apache/commons/lang3/ImmutablePair.java rename to src/main/java/org/apache/commons/lang3/tuple/ImmutablePair.java index 2772ef862..951843e3d 100644 --- a/src/main/java/org/apache/commons/lang3/ImmutablePair.java +++ b/src/main/java/org/apache/commons/lang3/tuple/ImmutablePair.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.lang3; +package org.apache.commons.lang3.tuple; /** *

An immutable pair consisting of two {@code Object} elements.

diff --git a/src/main/java/org/apache/commons/lang3/MutablePair.java b/src/main/java/org/apache/commons/lang3/tuple/MutablePair.java similarity index 98% rename from src/main/java/org/apache/commons/lang3/MutablePair.java rename to src/main/java/org/apache/commons/lang3/tuple/MutablePair.java index 685f2c037..3a0389981 100644 --- a/src/main/java/org/apache/commons/lang3/MutablePair.java +++ b/src/main/java/org/apache/commons/lang3/tuple/MutablePair.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.lang3; +package org.apache.commons.lang3.tuple; /** *

A mutable pair consisting of two {@code Object} elements.

diff --git a/src/main/java/org/apache/commons/lang3/Pair.java b/src/main/java/org/apache/commons/lang3/tuple/Pair.java similarity index 98% rename from src/main/java/org/apache/commons/lang3/Pair.java rename to src/main/java/org/apache/commons/lang3/tuple/Pair.java index ce005de42..2b9bfe12d 100644 --- a/src/main/java/org/apache/commons/lang3/Pair.java +++ b/src/main/java/org/apache/commons/lang3/tuple/Pair.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.lang3; +package org.apache.commons.lang3.tuple; import java.io.Serializable; import java.util.Formatter; import java.util.Map; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.builder.CompareToBuilder; /** diff --git a/src/main/java/org/apache/commons/lang3/tuple/package.html b/src/main/java/org/apache/commons/lang3/tuple/package.html new file mode 100644 index 000000000..5333bc908 --- /dev/null +++ b/src/main/java/org/apache/commons/lang3/tuple/package.html @@ -0,0 +1,22 @@ + + + +Tuple classes, starting with a Pair class in version 3.0. +@since 3.0 + + diff --git a/src/test/java/org/apache/commons/lang3/ImmutablePairTest.java b/src/test/java/org/apache/commons/lang3/tuple/ImmutablePairTest.java similarity index 99% rename from src/test/java/org/apache/commons/lang3/ImmutablePairTest.java rename to src/test/java/org/apache/commons/lang3/tuple/ImmutablePairTest.java index 37b35e4c3..42ba48880 100644 --- a/src/test/java/org/apache/commons/lang3/ImmutablePairTest.java +++ b/src/test/java/org/apache/commons/lang3/tuple/ImmutablePairTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.lang3; +package org.apache.commons.lang3.tuple; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/test/java/org/apache/commons/lang3/MutablePairTest.java b/src/test/java/org/apache/commons/lang3/tuple/MutablePairTest.java similarity index 99% rename from src/test/java/org/apache/commons/lang3/MutablePairTest.java rename to src/test/java/org/apache/commons/lang3/tuple/MutablePairTest.java index 7943ca2dc..ffb8ed992 100644 --- a/src/test/java/org/apache/commons/lang3/MutablePairTest.java +++ b/src/test/java/org/apache/commons/lang3/tuple/MutablePairTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.lang3; +package org.apache.commons.lang3.tuple; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/test/java/org/apache/commons/lang3/PairTest.java b/src/test/java/org/apache/commons/lang3/tuple/PairTest.java similarity index 99% rename from src/test/java/org/apache/commons/lang3/PairTest.java rename to src/test/java/org/apache/commons/lang3/tuple/PairTest.java index 9b55b1a66..e6aeb13a0 100644 --- a/src/test/java/org/apache/commons/lang3/PairTest.java +++ b/src/test/java/org/apache/commons/lang3/tuple/PairTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.lang3; +package org.apache.commons.lang3.tuple; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse;