Class SetUtils

java.lang.Object
org.sonar.java.collections.SetUtils

public final class SetUtils extends Object
This class is used for Java < 9 to simplify the creation of maps. After moving to Java > 9, should be replaced by Immutable Set Static Factory Methods
See Also:
Immutable Set Static Factory Methods
  • Method Details

    • immutableSetOf

      @SafeVarargs public static <T> Set<T> immutableSetOf(T... elements)
    • concat

      @SafeVarargs public static <T> Set<T> concat(Set<T>... sets)
    • difference

      public static <T> Set<T> difference(Set<T> set1, Set<T> set2)
    • getOnlyElement

      public static <T> T getOnlyElement(Set<T> set)