本文整理了Java中reactor.util.function.Tuples.fn6()
方法的一些代码示例,展示了Tuples.fn6()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tuples.fn6()
方法的具体详情如下:
包路径:reactor.util.function.Tuples
类名称:Tuples
方法名:fn6
[英]A converting function from Object array to Tuple6
[中]从对象数组到Tuple6的转换函数
代码示例来源:origin: reactor/reactor-core
/**
* A converting function from Object array to {@link Tuple6} to R.
*
* @param <T1> The type of the first value.
* @param <T2> The type of the second value.
* @param <T3> The type of the third value.
* @param <T4> The type of the fourth value.
* @param <T5> The type of the fifth value.
* @param <T6> The type of the sixth value.
* @param <R> The type of the return value.
* @param delegate the function to delegate to
*
* @return The unchecked conversion function to R.
*/
public static <T1, T2, T3, T4, T5, T6, R> Function<Object[], R> fn6(final Function<Tuple6<T1, T2, T3, T4, T5, T6>, R> delegate) {
return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6>fn6().apply(objects));
}
代码示例来源:origin: reactor/reactor-core
Publisher<? extends T5> source5,
Publisher<? extends T6> source6) {
return zip(Tuples.fn6(), source1, source2, source3, source4, source5, source6);
代码示例来源:origin: reactor/reactor-core
@Test
public void fn6() {
Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
Tuple6<Object, Object, Object, Object, Object, Object> tuple = Tuples.fn6().apply(source);
assertThat(tuple.getT1()).isEqualTo(1);
assertThat(tuple.getT2()).isEqualTo(2);
assertThat(tuple.getT3()).isEqualTo(3);
assertThat(tuple.getT4()).isEqualTo(4);
assertThat(tuple.getT5()).isEqualTo(5);
assertThat(tuple.getT6()).isEqualTo(6);
assertThat(tuple)
.isInstanceOf(Tuple8.class)
.containsExactly(1, 2, 3, 4, 5, 6, 7, 8);
}
代码示例来源:origin: reactor/reactor-core
@Test
public void fn6Delegate() {
Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
Function<Tuple6<Integer, Integer, Integer, Integer, Integer, Integer>, Tuple6> invert =
t6 -> new Tuple6<>(t6.getT6(), t6.getT5(), t6.getT4(), t6.getT3(), t6.getT2(), t6.getT1());
Tuple6 tuple = Tuples.fn6(invert).apply(source);
assertThat(tuple.getT1()).isEqualTo(6);
assertThat(tuple.getT2()).isEqualTo(5);
assertThat(tuple.getT3()).isEqualTo(4);
assertThat(tuple.getT4()).isEqualTo(3);
assertThat(tuple.getT5()).isEqualTo(2);
assertThat(tuple.getT6()).isEqualTo(1);
assertThat((Object) tuple).isExactlyInstanceOf(Tuple6.class);
}
代码示例来源:origin: io.projectreactor/reactor-core
/**
* A converting function from Object array to {@link Tuple6} to R.
*
* @param <T1> The type of the first value.
* @param <T2> The type of the second value.
* @param <T3> The type of the third value.
* @param <T4> The type of the fourth value.
* @param <T5> The type of the fifth value.
* @param <T6> The type of the sixth value.
* @param <R> The type of the return value.
* @param delegate the function to delegate to
*
* @return The unchecked conversion function to R.
*/
public static <T1, T2, T3, T4, T5, T6, R> Function<Object[], R> fn6(final Function<Tuple6<T1, T2, T3, T4, T5, T6>, R> delegate) {
return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6>fn6().apply(objects));
}
代码示例来源:origin: io.projectreactor/reactor-core
Publisher<? extends T5> source5,
Publisher<? extends T6> source6) {
return zip(Tuples.fn6(), source1, source2, source3, source4, source5, source6);
内容来源于网络,如有侵权,请联系作者删除!