summaryrefslogtreecommitdiffstats
path: root/policy-utils
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2020-06-19 15:23:27 +0100
committerwaynedunican <wayne.dunican@est.tech>2020-06-29 17:18:11 +0100
commita2a84654f27648091db9c49abc8f7b8afa391e73 (patch)
treed5ad1853c70d81d2d47ee9720b7b3b5d46ac9742 /policy-utils
parent119a9c73934c57046ed1e591a7e26dd67c715aa9 (diff)
Clean up of Pair classes - drools-pdp
Removed Pair class from drools-pdp and replaced with Apache Common Pair class Issue-ID: POLICY-2202 Change-Id: Ica2a5b734fb6eebfc0713027c1c4dc3b8d3882c8 Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'policy-utils')
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java63
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java68
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java2
3 files changed, 2 insertions, 131 deletions
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java
deleted file mode 100644
index c37084f4..00000000
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/Pair.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * policy-utils
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.drools.utils;
-
-public class Pair<F, S> {
-
- protected F first;
- protected S second;
-
- public Pair(F first, S second) {
- this.first = first;
- this.second = second;
- }
-
- public F first() {
- return this.first;
- }
-
- public void first(F first) {
- this.first = first;
- }
-
- public S second() {
- return this.second;
- }
-
- public void second(S second) {
- this.second = second;
- }
-
- public F getFirst() {
- return this.first;
- }
-
- public S getSecond() {
- return this.second;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("Pair [first=").append(first).append(", second=").append(second).append("]");
- return builder.toString();
- }
-}
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java
deleted file mode 100644
index ca792a1c..00000000
--- a/policy-utils/src/test/java/org/onap/policy/drools/utils/PairTripleTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * policy-utils
- * ================================================================================
- * Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.drools.utils;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.Test;
-
-public class PairTripleTest {
-
- @Test
- public void testPair() {
- Pair<String, String> pair = new Pair<String, String>("foo", "bar");
-
- assertEquals("foo", pair.first());
- assertEquals("bar", pair.second());
- assertEquals("foo", pair.getFirst());
- assertEquals("bar", pair.getSecond());
-
- pair.first("one");
- pair.second("two");
-
- assertEquals("one", pair.first());
- assertEquals("two", pair.second());
- assertEquals("one", pair.getFirst());
- assertEquals("two", pair.getSecond());
-
- assertNotNull(pair.toString());
-
- }
-
- @Test
- public void testTriple() {
- Triple<String, String, String> triple = new Triple<String, String, String>("foo", "bar", "fiz");
-
- assertEquals("foo", triple.first());
- assertEquals("bar", triple.second());
- assertEquals("fiz", triple.third());
-
- triple.first("one");
- triple.second("two");
- triple.third("three");
-
- assertEquals("one", triple.first());
- assertEquals("two", triple.second());
- assertEquals("three", triple.third());
- }
-
-}
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java
index ff613938..7f04b163 100644
--- a/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java
+++ b/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,5 +57,6 @@ public class TripleTest {
triple.setThird("III");
Assert.assertTrue("III".equals(triple.third()));
+
}
} \ No newline at end of file