io.sphere.sdk.utils.SetUtils Maven / Gradle / Ivy
package io.sphere.sdk.utils;
import java.util.HashSet;
import java.util.Set;
import static java.util.Arrays.asList;
public final class SetUtils {
private SetUtils() {
}
@SafeVarargs
@SuppressWarnings("varargs")
public static Set asSet(final T ... params) {
return new HashSet<>(asList(params));
}
public static Set setOf(final T element, final Set set) {
final Set result = new HashSet<>(1 + set.size());
result.add(element);
result.addAll(set);
return result;
}
public static Set setOf(final T element, final T[] array) {
return setOf(element, asSet(array));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy