Fix the nonstandard coding.
[aai/esr-server.git] / esr-mgr / src / main / java / org / onap / aai / esr / util / ExtsysUtil.java
index b8a120c..c3814e3 100644 (file)
@@ -17,33 +17,22 @@ package org.onap.aai.esr.util;
 
 import com.google.gson.Gson;
 
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Date;
+import java.util.List;
 import java.util.UUID;
-
-import org.onap.aai.esr.entity.aai.AuthInfo;
 import org.onap.aai.esr.entity.aai.EsrSystemInfo;
 import org.onap.aai.esr.entity.aai.EsrSystemInfoList;
 
 public class ExtsysUtil {
-//  private final static Logger logger = LoggerFactory.getLogger(ExtsysUtil.class);
 
-  public static String generateId() {
+  public String generateId() {
     return UUID.randomUUID().toString();
   }
 
-  public static boolean isNotEmpty(String str) {
-    return str != null && !"".equals(str) && str.length() > 0;
-  }
-
   /**
    * change object to str.
    */
-  public static String objectToString(Object obj) {
+  public String objectToString(Object obj) {
     Gson gson = new Gson();
     if (obj != null) {
       return gson.toJson(obj);
@@ -52,26 +41,17 @@ public class ExtsysUtil {
     }
   }
 
-  public static String getNowTime() {
-    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-    return sdf.format(new Date());
-  }
-  
-  public static EsrSystemInfoList getEsrSystemInfoListFromAuthInfo(AuthInfo authInfo) {
+  public EsrSystemInfoList getEsrSystemInfoListFromAuthInfo(EsrSystemInfo esrSystemInfoObj) {
     EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
-    EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
-    ArrayList<AuthInfo> authInfos = new ArrayList<AuthInfo>();
-    authInfos.add(authInfo);
-    esrSystemInfo.setEsrSystemInfo(authInfos);
+    List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
+    esrSystemInfo.add(esrSystemInfoObj);
     esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
     return esrSystemInfoList;
   }
   
-  public static EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(ArrayList<AuthInfo> authInfos) {
+  public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(List<EsrSystemInfo> esrSystemInfo) {
     EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
-    EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
-    esrSystemInfo.setEsrSystemInfo(authInfos);
-    esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+    esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);;
     return esrSystemInfoList;
   }
 }