summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src/main/java
diff options
context:
space:
mode:
authorJonathan Gathman <jonathan.gathman@att.com>2018-05-22 20:33:21 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-22 20:33:21 +0000
commit7a5a06cf41dde0577aecdaab37c59fcdb1a0dd46 (patch)
tree665bd9604fc3071aeec623cae3877afdee07918f /auth/auth-batch/src/main/java
parentec4f01ac5eb93a13a43566e4322df62ee8fc127d (diff)
parent2fac1e3e6b3dabb89e960b71e6a3f5bc1b8d9f00 (diff)
Merge "fixes in NsAttrib"
Diffstat (limited to 'auth/auth-batch/src/main/java')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NsAttrib.java39
1 files changed, 20 insertions, 19 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NsAttrib.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NsAttrib.java
index bb76c34c..eafbe909 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NsAttrib.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NsAttrib.java
@@ -23,6 +23,7 @@ package org.onap.aaf.auth.helpers;
import java.util.ArrayList;
import java.util.List;
+import java.util.SortedMap;
import java.util.TreeMap;
import org.onap.aaf.misc.env.Env;
@@ -36,11 +37,24 @@ import com.datastax.driver.core.SimpleStatement;
import com.datastax.driver.core.Statement;
public class NsAttrib {
- public static final List<NsAttrib> data = new ArrayList<NsAttrib>();
- public static final TreeMap<String,List<NsAttrib>> byKey = new TreeMap<String,List<NsAttrib>>();
- public static final TreeMap<String,List<NsAttrib>> byNS = new TreeMap<String,List<NsAttrib>>();
+ public static final List<NsAttrib> data = new ArrayList<>();
+ public static final SortedMap<String,List<NsAttrib>> byKey = new TreeMap<>();
+ public static final SortedMap<String,List<NsAttrib>> byNS = new TreeMap<>();
- public final String ns,key,value;
+ public final String ns;
+ public final String key;
+ public final String value;
+ public static Creator<NsAttrib> v2_0_11 = new Creator<NsAttrib>() {
+ @Override
+ public NsAttrib create(Row row) {
+ return new NsAttrib(row.getString(0), row.getString(1), row.getString(2));
+ }
+
+ @Override
+ public String select() {
+ return "select ns,key,value from authz.ns_attrib";
+ }
+ };
public NsAttrib(String ns, String key, String value) {
this.ns = ns;
@@ -69,14 +83,14 @@ public class NsAttrib {
List<NsAttrib> lna = byKey.get(ur.key);
if(lna==null) {
- lna = new ArrayList<NsAttrib>();
+ lna = new ArrayList<>();
byKey.put(ur.key, lna);
}
lna.add(ur);
lna = byNS.get(ur.ns);
if(lna==null) {
- lna = new ArrayList<NsAttrib>();
+ lna = new ArrayList<>();
byNS.put(ur.ns, lna);
}
lna.add(ur);
@@ -87,19 +101,6 @@ public class NsAttrib {
}
}
- public static Creator<NsAttrib> v2_0_11 = new Creator<NsAttrib>() {
- @Override
- public NsAttrib create(Row row) {
- return new NsAttrib(row.getString(0), row.getString(1), row.getString(2));
- }
-
- @Override
- public String select() {
- return "select ns,key,value from authz.ns_attrib";
- }
- };
-
-
public String toString() {
return '"' + ns + "\",\"" + key + "\",\"" + value +'"';
}