All Downloads are FREE. Search and download functionalities are using the official Maven repository.

in.ashwanthkumar.utils.collections.Sets Maven / Gradle / Ivy

There is a newer version: 0.1.0
Show newest version
package in.ashwanthkumar.utils.collections;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class Sets {

    public static  Set of(T... elements) {
        Set set = new HashSet();
        Collections.addAll(set, elements);
        return set;
    }

    public static  Set copy(Set input) {
        HashSet copy = new HashSet();
        copy.addAll(input);
        return copy;
    }

    public static  boolean isEmpty(Set set) {
        return set == null || set.isEmpty();
    }

    public static  boolean nonEmpty(Set set) {
        return !isEmpty(set);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy