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)
| 128 | * {@link Collection}; {@code StreamSupport.stream(iterable.spliterator(), false)} otherwise. |
| 129 | */ |
| 130 | public static <E> FluentIterable<E> from(final Iterable<E> iterable) { |
| 131 | return (iterable instanceof FluentIterable) |
| 132 | ? (FluentIterable<E>) iterable |
| 133 | : new FluentIterable<E>(iterable) { |
| 134 | @Override |
| 135 | public Iterator<E> iterator() { |
| 136 | return iterable.iterator(); |
| 137 | } |
| 138 | }; |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Returns a fluent iterable containing {@code elements} in the specified order. |
no test coverage detected