MCPcopy
hub / github.com/google/guava / from

Method from

guava/src/com/google/common/collect/FluentIterable.java:139–148  ·  view source on GitHub ↗

Returns a fluent iterable that wraps {@code iterable}, or {@code iterable} itself if it is already a {@code FluentIterable}. <p><b>{@code Stream} equivalent:</b> {@link Collection#stream} if {@code iterable} is a {@link Collection}; {@link Streams#stream(Iterable)} otherwise.

(Iterable<E> iterable)

Source from the content-addressed store, hash-verified

137 * Collection}; {@link Streams#stream(Iterable)} otherwise.
138 */
139 public static <E extends @Nullable Object> FluentIterable<E> from(Iterable<E> iterable) {
140 return (iterable instanceof FluentIterable)
141 ? (FluentIterable<E>) iterable
142 : new FluentIterable<E>(iterable) {
143 @Override
144 public Iterator<E> iterator() {
145 return iterable.iterator();
146 }
147 };
148 }
149
150 /**
151 * Returns a fluent iterable containing {@code elements} in the specified order.

Callers 15

ofMethod · 0.95
cycleMethod · 0.95
filterMethod · 0.95
transformMethod · 0.95
skipMethod · 0.95
limitMethod · 0.95
getDeclaredAnnotationMethod · 0.95
delegateMethod · 0.95
delegateMethod · 0.95
rawTypesMethod · 0.95
delegateMethod · 0.95

Calls 2

asListMethod · 0.45
checkNotNullMethod · 0.45