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

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

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

Tuples.fn7介绍

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

代码示例

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

/**
 * A converting function from Object array to {@link Tuple7} 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 <T7> The type of the seventh 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, T7, R> Function<Object[], R> fn7(final Function<Tuple7<T1, T2, T3, T4, T5, T6, T7>, R> delegate) {
  return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6, T7>fn7().apply(objects));
}

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

Publisher<? extends T6> source6,
  Publisher<? extends T7> source7) {
return zip(Tuples.fn7(), source1, source2, source3, source4, source5, source6, source7);

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

@Test
public void fn7() {
  Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
  Tuple7<Object, Object, Object, Object, Object, Object, Object> tuple = Tuples.fn7().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.getT7()).isEqualTo(7);
  assertThat(tuple)
      .isInstanceOf(Tuple8.class)
      .containsExactly(1, 2, 3, 4, 5, 6, 7, 8);
}

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

@Test
public void fn7Delegate() {
  Integer[] source = new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 };
  Function<Tuple7<Integer, Integer, Integer, Integer, Integer, Integer, Integer>, Tuple7> invert =
      t7 -> new Tuple7<>(t7.getT7(), t7.getT6(), t7.getT5(), t7.getT4(), t7.getT3(), t7.getT2(), t7.getT1());
  Tuple7 tuple = Tuples.fn7(invert).apply(source);
  assertThat(tuple.getT1()).isEqualTo(7);
  assertThat(tuple.getT2()).isEqualTo(6);
  assertThat(tuple.getT3()).isEqualTo(5);
  assertThat(tuple.getT4()).isEqualTo(4);
  assertThat(tuple.getT5()).isEqualTo(3);
  assertThat(tuple.getT6()).isEqualTo(2);
  assertThat(tuple.getT7()).isEqualTo(1);
  assertThat((Object) tuple).isExactlyInstanceOf(Tuple7.class);
}
@Test

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

/**
 * A converting function from Object array to {@link Tuple7} 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 <T7> The type of the seventh 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, T7, R> Function<Object[], R> fn7(final Function<Tuple7<T1, T2, T3, T4, T5, T6, T7>, R> delegate) {
  return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6, T7>fn7().apply(objects));
}

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

Publisher<? extends T6> source6,
  Publisher<? extends T7> source7) {
return zip(Tuples.fn7(), source1, source2, source3, source4, source5, source6, source7);

相关文章