Returns a fluent iterable that wraps iterable, or iterable itself if it is already a FluentIterable. Stream equivalent: iterable.stream() if iterable is a Collection; StreamSupport.stream(iterable.spliterator(), false) otherw
(final Iterable<E> iterable)
| 130 | |
| 131 | |
| 132 | public static <E> FluentIterable<E> from(final Iterable<E> iterable) { |
| 133 | return (iterable instanceof FluentIterable) |
| 134 | ? (FluentIterable<E>) iterable |
| 135 | : new FluentIterable<E>(iterable) { |
| 136 | @Override |
| 137 | public Iterator<E> iterator() { |
| 138 | return iterable.iterator(); |
| 139 | } |
| 140 | }; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Returns a fluent iterable containing {@code elements} in the specified order. |
no test coverage detected