Record types and constructing
RecordMapper.
The various mapping() methods can be used e.g. to map between
Record types and constructors of known degree, such as in this
example:
record Actor (int id, String firstName, String lastName) {}
List<Actor> actors =
ctx.select(ACTOR.ID, ACTOR.FIRST_NAME, ACTOR.LAST_NAME)
.from(ACTOR)
.fetch(mapping(Actor::new));
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static final <E, R extends Record1 | intoArray(E[] a)
Create a collector that can collect |
| public static final <E, R extends Record1 | intoArray(Class<? extends E> componentType)
Create a collector that can collect |
| public static final <E, R extends Record> Collector | intoArray(E[] a, Function<? super R, ? extends E> function)
Create a collector that can collect |
| public static final <E, R extends Record> Collector | intoArray(Class<? extends E> componentType, Function<? super R, ? extends E> function)
Create a collector that can collect |
| public static final <K, V, R extends Record2 | intoGroups()
Create a collector that can collect |
| public static final <K, R extends Record> Collector | intoGroups(Function<? super R, ? extends K> keyMapper)
Create a collector that can collect |
| public static final <K, V, R extends Record> Collector | intoGroups(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)
Create a collector that can collect |
| public static final <E, R extends Record1 | intoList()
Create a collector that can collect |
| public static final <E, R extends Record> Collector | intoList(Function<? super R, ? extends E> function)
Create a collector that can collect |
| public static final <K, V, R extends Record2 | intoMap()
Create a collector that can collect |
| public static final <K, R extends Record> Collector | intoMap(Function<? super R, ? extends K> keyMapper)
Create a collector that can collect |
| public static final <K, V, R extends Record> Collector | intoMap(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)
Create a collector that can collect |
| public static final <K, R extends Record> Collector | intoResultGroups(Function<? super R, ? extends K> keyMapper)
Create a collector that can collect |
| public static final <K, V extends Record, R extends Record> Collector | intoResultGroups(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)
Create a collector that can collect |
| public static final <E, R extends Record1 | intoSet()
Create a collector that can collect |
| public static final <E, R extends Record> Collector | intoSet(Function<? super R, ? extends E> function)
Create a collector that can collect |
| public static final <T1, R extends Record1 | mapping(Function1<? super T1, ? extends U> function)
Create a |
| public static final <T1, T2, R extends Record2 | mapping(Function2<? super T1, ? super T2, ? extends U> function)
Create a |
| public static final <T1, T2, T3, R extends Record3 | mapping(Function3<? super T1, ? super T2, ? super T3, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, R extends Record4 | mapping(Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, R extends Record5 | mapping(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, R extends Record6 | mapping(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, R extends Record7 | mapping(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, R extends Record8 | mapping(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, R extends Record9 | mapping(Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R extends Record10 | mapping(Function10<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R extends Record11 | mapping(Function11<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R extends Record12 | mapping(Function12<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R extends Record13 | mapping(Function13<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R extends Record14 | mapping(Function14<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R extends Record15 | mapping(Function15<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R extends Record16 | mapping(Function16<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R extends Record17 | mapping(Function17<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R extends Record18 | mapping(Function18<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R extends Record19 | mapping(Function19<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R extends Record20 | mapping(Function20<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R extends Record21 | mapping(Function21<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? extends U> function)
Create a |
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R extends Record22 | mapping(Function22<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? super T22, ? extends U> function)
Create a |
| private static final <K, V> Function | |
| private static final <T> Function |
| NULL | back to summary |
|---|---|
| private static final Object NULL | |
| Records | back to summary |
|---|---|
| public Records() | |
| intoArray | back to summary |
|---|---|
| public static final <E, R extends Record1 Create a collector that can collect For example:
This is the same as the following, but allows for omitting repeating the
| |
| intoArray | back to summary |
|---|---|
| public static final <E, R extends Record1 Create a collector that can collect For example:
This is the same as the following:
| |
| intoArray | back to summary |
|---|---|
| public static final <E, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| intoArray | back to summary |
|---|---|
| public static final <E, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| intoGroups | back to summary |
|---|---|
| public static final <K, V, R extends Record2 Create a collector that can collect For example:
This is the same as the following, but allows for omitting repeating the
| |
| intoGroups | back to summary |
|---|---|
| public static final <K, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| intoGroups | back to summary |
|---|---|
| public static final <K, V, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| intoList | back to summary |
|---|---|
| public static final <E, R extends Record1 Create a collector that can collect For example:
This is the same as the following, but allows for omitting repeating the
| |
| intoList | back to summary |
|---|---|
| public static final <E, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| intoMap | back to summary |
|---|---|
| public static final <K, V, R extends Record2 Create a collector that can collect
Collection throws For example:
This is the same as the following, but allows for omitting repeating the
| |
| intoMap | back to summary |
|---|---|
| public static final <K, R extends Record> Collector Create a collector that can collect
Collection throws For example:
This is the same as the following:
| |
| intoMap | back to summary |
|---|---|
| public static final <K, V, R extends Record> Collector Create a collector that can collect
Collection throws For example:
This is the same as the following:
| |
| intoResultGroups | back to summary |
|---|---|
| public static final <K, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| intoResultGroups | back to summary |
|---|---|
| public static final <K, V extends Record, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| intoSet | back to summary |
|---|---|
| public static final <E, R extends Record1 Create a collector that can collect For example:
This is the same as the following, but allows for omitting repeating the
| |
| intoSet | back to summary |
|---|---|
| public static final <E, R extends Record> Collector Create a collector that can collect For example:
This is the same as the following:
| |
| mapping | back to summary |
|---|---|
| public static final <T1, R extends Record1 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, R extends Record2 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, R extends Record3 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, R extends Record4 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, R extends Record5 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, R extends Record6 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, R extends Record7 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, R extends Record8 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, R extends Record9 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R extends Record10 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R extends Record11 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R extends Record12 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R extends Record13 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R extends Record14 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R extends Record15 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R extends Record16 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R extends Record17 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R extends Record18 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R extends Record19 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R extends Record20 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R extends Record21 Create a
Combine this with e.g. | |
| mapping | back to summary |
|---|---|
| public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R extends Record22 Create a
Combine this with e.g. | |
| unwrapNulls | back to summary |
|---|---|
private static final <K, V> Function
| |
| wrapNulls | back to summary |
|---|---|
| private static final <T> Function | |