MCPcopy Create free account
hub / github.com/jOOQ/jOOQ / flatMap

Method flatMap

jOOQ/src/main/java/org/jooq/impl/Tools.java:2718–2727  ·  view source on GitHub ↗

Like Stream.of(array).map(mapper).toList() but without the entire stream pipeline.

(Iterable<? extends T> it, ThrowingFunction<? super T, ? extends List<? extends U>, E> mapper)

Source from the content-addressed store, hash-verified

2716 * without the entire stream pipeline.
2717 */
2718 static final <T, U, E extends Exception> List<U> flatMap(Iterable<? extends T> it, ThrowingFunction<? super T, ? extends List<? extends U>, E> mapper) throws E {
2719 if (it == null)
2720 return emptyList();
2721
2722 List<U> result = newListWithCapacity(it);
2723 for (T t : it)
2724 result.addAll(mapper.apply(t));
2725
2726 return result;
2727 }
2728
2729 /**
2730 * Like <code>Stream.of(array).zipWithIndex().map(mapper).toList()</code>

Callers 15

generateTablesMethod · 0.80
getUniqueKeysMethod · 0.80
getForeignKeysMethod · 0.80
getIndexesMethod · 0.80
patchMethod · 0.80
fieldsMethod · 0.80
getSchemas0Method · 0.80
getTables0Method · 0.80
getSchemas0Method · 0.80
getTables0Method · 0.80
getUDTs0Method · 0.80
getDomains0Method · 0.80

Calls 4

newListWithCapacityMethod · 0.95
emptyListMethod · 0.80
addAllMethod · 0.65
applyMethod · 0.65

Tested by

no test coverage detected