diff options
author | Pawel <pawel.kasperkiewicz@nokia.com> | 2018-05-22 08:20:32 -0400 |
---|---|---|
committer | Pawel <pawel.kasperkiewicz@nokia.com> | 2018-05-22 08:20:32 -0400 |
commit | 2fac1e3e6b3dabb89e960b71e6a3f5bc1b8d9f00 (patch) | |
tree | 2d0bd01a973ab252092d4225f37de20c888069d8 /auth/auth-batch/src/main | |
parent | 8c6365116711469c74436141d63f046ef88b9023 (diff) |
fixes in NsAttrib
Change-Id: If01b8a890bd376a6dfef4da6bd5de23af3d083f0
Issue-ID: AAF-314
Signed-off-by: Pawel <pawel.kasperkiewicz@nokia.com>
Diffstat (limited to 'auth/auth-batch/src/main')
-rw-r--r-- | auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NsAttrib.java | 39 |
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 +'"'; } |