@Test public void ipStrToListTest_unvali() { String ipStr = "127.0.0|0.0.0.2|127.0.0.4"; List<String> ipList = EventBusSpring.ipStrToList(ipStr); assertEquals(ipList.get(0),"0.0.0.2"); assertEquals(ipList.get(1),"127.0.0.4"); }
public static List<String> ipStrToList(String blackIpStr) { List<String> ips = new ArrayList<String>(); if(blackIpStr != null && !blackIpStr.equals("")) { String[] arr = blackIpStr.split("\\|"); for(String ip : arr) { if(HostUtils.isValidIpAddress(ip)) { ips.add(ip); } } } return ips; }
EventBusSpring { public static List<String> ipStrToList(String blackIpStr) { List<String> ips = new ArrayList<String>(); if(blackIpStr != null && !blackIpStr.equals("")) { String[] arr = blackIpStr.split("\\|"); for(String ip : arr) { if(HostUtils.isValidIpAddress(ip)) { ips.add(ip); } } } return ips; } }
EventBusSpring { public static List<String> ipStrToList(String blackIpStr) { List<String> ips = new ArrayList<String>(); if(blackIpStr != null && !blackIpStr.equals("")) { String[] arr = blackIpStr.split("\\|"); for(String ip : arr) { if(HostUtils.isValidIpAddress(ip)) { ips.add(ip); } } } return ips; } EventBusSpring(EventBus eventBus);  EventBusSpring(EventBus eventBus, List<Object> subscribers);  EventBusSpring(EventBus eventBus, List<Object> subscribers, String blackIpStr);  EventBusSpring(EventBus eventBus, List<Object> subscribers, String blackIpStr,boolean needEncryptEvent);  EventBusSpring(EventBus eventBus, List<Object> subscribers,List<String> blackIps); }
EventBusSpring { public static List<String> ipStrToList(String blackIpStr) { List<String> ips = new ArrayList<String>(); if(blackIpStr != null && !blackIpStr.equals("")) { String[] arr = blackIpStr.split("\\|"); for(String ip : arr) { if(HostUtils.isValidIpAddress(ip)) { ips.add(ip); } } } return ips; } EventBusSpring(EventBus eventBus);  EventBusSpring(EventBus eventBus, List<Object> subscribers);  EventBusSpring(EventBus eventBus, List<Object> subscribers, String blackIpStr);  EventBusSpring(EventBus eventBus, List<Object> subscribers, String blackIpStr,boolean needEncryptEvent);  EventBusSpring(EventBus eventBus, List<Object> subscribers,List<String> blackIps); synchronized void start(); synchronized void stop(); synchronized void setSubscribers(List<Object> subscribers); static List<String> ipStrToList(String blackIpStr); }
EventBusSpring { public static List<String> ipStrToList(String blackIpStr) { List<String> ips = new ArrayList<String>(); if(blackIpStr != null && !blackIpStr.equals("")) { String[] arr = blackIpStr.split("\\|"); for(String ip : arr) { if(HostUtils.isValidIpAddress(ip)) { ips.add(ip); } } } return ips; } EventBusSpring(EventBus eventBus);  EventBusSpring(EventBus eventBus, List<Object> subscribers);  EventBusSpring(EventBus eventBus, List<Object> subscribers, String blackIpStr);  EventBusSpring(EventBus eventBus, List<Object> subscribers, String blackIpStr,boolean needEncryptEvent);  EventBusSpring(EventBus eventBus, List<Object> subscribers,List<String> blackIps); synchronized void start(); synchronized void stop(); synchronized void setSubscribers(List<Object> subscribers); static List<String> ipStrToList(String blackIpStr);  }