Class Iterables

java.lang.Object
ru.progrm_jarvis.javacommons.collection.Iterables

public final class Iterables extends Object
Utilities related to iterables.
  • Method Details

    • toList

      @NotNull public static <T> @NotNull @Unmodifiable List<T> toList(@NotNull @NotNull Iterable<T> iterable)
      Converts the given iterable into unmodifiable List.
      Type Parameters:
      T - type of the elements
      Parameters:
      iterable - iterable to be converted
      Returns:
      creates unmodifiable list
    • toModifiableList

      @NotNull public static <T> @NotNull List<T> toModifiableList(@NotNull @NotNull Iterable<T> iterable)
      Converts the given iterable into modifiable List.
      Type Parameters:
      T - type of the elements
      Parameters:
      iterable - iterable to be converted
      Returns:
      creates modifiable list
    • toSet

      @NotNull public static <T> @NotNull @Unmodifiable Set<T> toSet(@NotNull @NotNull Iterable<T> iterable)
      Converts the given iterable into unmodifiable Set.
      Type Parameters:
      T - type of the elements
      Parameters:
      iterable - iterable to be converted
      Returns:
      creates unmodifiable set
    • toModifiableSet

      @NotNull public static <T> @NotNull Set<T> toModifiableSet(@NotNull @NotNull Iterable<T> iterable)
      Converts the given iterable into unmodifiable Set.
      Type Parameters:
      T - type of the elements
      Parameters:
      iterable - iterable to be converted
      Returns:
      creates unmodifiable set