reactor.util.function.Tuples.fn8()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中reactor.util.function.Tuples.fn8()方法的一些代码示例,展示了Tuples.fn8()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tuples.fn8()方法的具体详情如下:
包路径:reactor.util.function.Tuples
类名称:Tuples
方法名:fn8

Tuples.fn8介绍

[英]A converting function from Object array to Tuple8
[中]从对象数组到Tuple8的转换函数

代码示例

代码示例来源:origin: reactor/reactor-core

  1. /**
  2. * A converting function from Object array to {@link Tuple8}
  3. *
  4. * @param <T1> The type of the first value.
  5. * @param <T2> The type of the second value.
  6. * @param <T3> The type of the third value.
  7. * @param <T4> The type of the fourth value.
  8. * @param <T5> The type of the fifth value.
  9. * @param <T6> The type of the sixth value.
  10. * @param <T7> The type of the seventh value.
  11. * @param <T8> The type of the eighth value.
  12. * @param <R> The type of the return value.
  13. * @param delegate the function to delegate to
  14. *
  15. * @return The unchecked conversion function to {@link Tuple8}.
  16. */
  17. public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Function<Object[], R> fn8(final Function<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>, R> delegate) {
  18. return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6, T7, T8>fn8().apply(objects));
  19. }

代码示例来源:origin: reactor/reactor-core

  1. Publisher<? extends T7> source7,
  2. Publisher<? extends T8> source8) {
  3. return zip(Tuples.fn8(), source1, source2, source3, source4, source5, source6, source7, source8);

代码示例来源:origin: reactor/reactor-core

  1. @Test
  2. public void fn8() {
  3. Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
  4. Tuple8 tuple = Tuples.fn8().apply(source);
  5. assertThat(tuple.getT1()).isEqualTo(1);
  6. assertThat(tuple.getT2()).isEqualTo(2);
  7. assertThat(tuple.getT3()).isEqualTo(3);
  8. assertThat(tuple.getT4()).isEqualTo(4);
  9. assertThat(tuple.getT5()).isEqualTo(5);
  10. assertThat(tuple.getT6()).isEqualTo(6);
  11. assertThat(tuple.getT7()).isEqualTo(7);
  12. assertThat(tuple.getT8()).isEqualTo(8);
  13. }

代码示例来源:origin: reactor/reactor-core

  1. @Test
  2. public void fn8Delegate() {
  3. Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
  4. Function<Tuple8<Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer>, Integer> sum =
  5. t8 -> t8.getT8() + t8.getT7() + t8.getT6() + t8.getT5() + t8.getT4() + t8.getT3() + t8.getT2() + t8.getT1();
  6. Integer result = Tuples.fn8(sum).apply(source);
  7. assertThat(result).isEqualTo(36);
  8. }

代码示例来源:origin: io.projectreactor/reactor-core

  1. /**
  2. * A converting function from Object array to {@link Tuple8}
  3. *
  4. * @param <T1> The type of the first value.
  5. * @param <T2> The type of the second value.
  6. * @param <T3> The type of the third value.
  7. * @param <T4> The type of the fourth value.
  8. * @param <T5> The type of the fifth value.
  9. * @param <T6> The type of the sixth value.
  10. * @param <T7> The type of the seventh value.
  11. * @param <T8> The type of the eighth value.
  12. * @param <R> The type of the return value.
  13. * @param delegate the function to delegate to
  14. *
  15. * @return The unchecked conversion function to {@link Tuple8}.
  16. */
  17. public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Function<Object[], R> fn8(final Function<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>, R> delegate) {
  18. return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6, T7, T8>fn8().apply(objects));
  19. }

代码示例来源:origin: io.projectreactor/reactor-core

  1. Publisher<? extends T7> source7,
  2. Publisher<? extends T8> source8) {
  3. return zip(Tuples.fn8(), source1, source2, source3, source4, source5, source6, source7, source8);

相关文章