Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

Sets.java 618B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (C) 2011, Christian Halstrick <christian.halstrick@sap.com> and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.lib;
  11. import java.util.Arrays;
  12. import java.util.HashSet;
  13. import java.util.Set;
  14. public class Sets {
  15. @SafeVarargs
  16. public static <T> Set<T> of(T... elements) {
  17. Set<T> ret = new HashSet<>();
  18. ret.addAll(Arrays.asList(elements));
  19. return ret;
  20. }
  21. }