X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=esr-mgr%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fesr%2Futil%2FExtsysUtil.java;h=2e1649ff93dab987d3196ee225a1d8f4ea18ad5b;hb=500519857b2a3fe08cf812fdae78d81944f5e0c4;hp=b8a120c0c1916fdd1e4d6365413b8b9ca8aec330;hpb=bb02e67db383ee68af8179c350e07a6c1ddffca9;p=aai%2Fesr-server.git diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java index b8a120c..2e1649f 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java @@ -20,30 +20,22 @@ 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.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() { 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 +44,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 authInfos = new ArrayList(); - authInfos.add(authInfo); - esrSystemInfo.setEsrSystemInfo(authInfos); + ArrayList esrSystemInfo = new ArrayList(); + esrSystemInfo.add(esrSystemInfoObj); esrSystemInfoList.setEsrSystemInfo(esrSystemInfo); return esrSystemInfoList; } - public static EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(ArrayList authInfos) { + public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(ArrayList esrSystemInfo) { EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); - EsrSystemInfo esrSystemInfo = new EsrSystemInfo(); - esrSystemInfo.setEsrSystemInfo(authInfos); - esrSystemInfoList.setEsrSystemInfo(esrSystemInfo); + esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);; return esrSystemInfoList; } }