package com.eactive.eai.rms.onl.transaction.extnl;

import org.apache.log4j.Logger;

public class KakaoCardInterfaceNamingRule {
   
   private static final Logger logger = Logger.getLogger(KakaoCardInterfaceNamingRule.class);
   
   public static String makeKey(String source, String target) {
      return source + "_" + target + "_";
   }

   public static String makeSeqKey(String source, String target) {
      return source + "_" + target;
   }
   
   public static String sourceTargetToIntfId(String source, String target, String seq) {
      return source + "_" + target + "_" + seq;
   }
   
   public static String getSourceFromIntfId(String interfaceId) {
      try {
         return interfaceId.split("_")[0];
      } catch (Exception e) {
         logger.warn(e);
         return "";
      }
   }
   
   public static String getTargetFromIntfId(String interfaceId) {
      try {
         return interfaceId.split("_")[1];
      } catch (Exception e) {
         logger.warn(e);
         return "";
      }
   }

}