001package gudusoft.gsqlparser.util;
002
003import java.util.Collection;
004import java.util.HashSet;
005import java.util.Map;
006import java.util.Set;
007
008@SuppressWarnings("rawtypes")
009public final class CollectionUtil {
010
011        @SafeVarargs
012        public static <T> Set<T> convertArraysToSet(T... items) {
013                Set<T> result = new HashSet<>();
014                if (items != null) {
015                        for (T element : items) {
016                                result.add(element);
017                        }
018                }
019                return result;
020        }
021
022        public static boolean isEmpty(Collection collection) {
023                return collection == null || collection.isEmpty();
024        }
025
026        public static boolean isEmpty(String... strs) {
027                return strs == null || strs.length < 1;
028        }
029
030        public static boolean isEmpty(Map map) {
031                return map == null || map.isEmpty();
032        }
033}