Class Iterables
java.lang.Object
ru.progrm_jarvis.javacommons.collection.Iterables
Utilities related to
iterables.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NotNull @Unmodifiable List<T>Converts the given iterable into unmodifiableList.static <T> @NotNull List<T>toModifiableList(@NotNull Iterable<T> iterable) Converts the given iterable into modifiableList.static <T> @NotNull Set<T>toModifiableSet(@NotNull Iterable<T> iterable) Converts the given iterable into unmodifiableSet.static <T> @NotNull @Unmodifiable Set<T>Converts the given iterable into unmodifiableSet.
-
Method Details
-
toList
@NotNull public static <T> @NotNull @Unmodifiable List<T> toList(@NotNull @NotNull Iterable<T> iterable) Converts the given iterable into unmodifiableList.- 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 modifiableList.- 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 unmodifiableSet.- Type Parameters:
T- type of the elements- Parameters:
iterable- iterable to be converted- Returns:
- creates unmodifiable set
-
toModifiableSet
Converts the given iterable into unmodifiableSet.- Type Parameters:
T- type of the elements- Parameters:
iterable- iterable to be converted- Returns:
- creates unmodifiable set
-