org.jooq.lambda.Unchecked.doubleConsumer()方法的使用及代码示例

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

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

Unchecked.doubleConsumer介绍

[英]Wrap a CheckedDoubleConsumer in a DoubleConsumer.

Example: ``

Arrays.stream(new double[] { 1.0, 2.0 }).forEach(Unchecked.doubleConsumer(d -> { 
if (d < 0.0) 
throw new Exception("Only positive numbers allowed"); 
}));

[中]将CheckedDoubleConsumer包装在DoubleConsumer中。
示例:``

Arrays.stream(new double[] { 1.0, 2.0 }).forEach(Unchecked.doubleConsumer(d -> { 
if (d < 0.0) 
throw new Exception("Only positive numbers allowed"); 
}));

代码示例

代码示例来源:origin: org.jooq/jool-java-8

/**
 * @see {@link Unchecked#doubleConsumer(CheckedDoubleConsumer)}
 */
static DoubleConsumer unchecked(CheckedDoubleConsumer consumer) {
  return Unchecked.doubleConsumer(consumer);
}

代码示例来源:origin: org.jooq/jool

/**
 * @see {@link Unchecked#doubleConsumer(CheckedDoubleConsumer)}
 */
static DoubleConsumer unchecked(CheckedDoubleConsumer consumer) {
  return Unchecked.doubleConsumer(consumer);
}

代码示例来源:origin: org.jooq/jool

/**
   * @see {@link Unchecked#doubleConsumer(CheckedDoubleConsumer, Consumer)}
   */
  static DoubleConsumer unchecked(CheckedDoubleConsumer consumer, Consumer<Throwable> handler) {
    return Unchecked.doubleConsumer(consumer, handler);
  }
}

代码示例来源:origin: org.jooq/jool

/**
 * Wrap a {@link CheckedDoubleConsumer} in a {@link DoubleConsumer}.
 * <p>
 * Example:
 * <code><pre>
 * Arrays.stream(new double[] { 1.0, 2.0 }).forEach(Unchecked.doubleConsumer(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 * }));
 * </pre></code>
 */
public static DoubleConsumer doubleConsumer(CheckedDoubleConsumer consumer) {
  return doubleConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
}

代码示例来源:origin: org.jooq/jool-java-8

/**
   * @see {@link Unchecked#doubleConsumer(CheckedDoubleConsumer, Consumer)}
   */
  static DoubleConsumer unchecked(CheckedDoubleConsumer consumer, Consumer<Throwable> handler) {
    return Unchecked.doubleConsumer(consumer, handler);
  }
}

代码示例来源:origin: org.jooq/jool

/**
 * Wrap a {@link CheckedDoubleConsumer} in a {@link DoubleConsumer}.
 * <p>
 * Example:
 * <code><pre>
 * Arrays.stream(new double[] { 1.0, 2.0 }).forEach(Unchecked.doubleConsumer(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 * }));
 * </pre></code>
 */
public static DoubleConsumer doubleConsumer(CheckedDoubleConsumer consumer) {
  return Unchecked.doubleConsumer(consumer, Unchecked.RETHROW_ALL);
}

代码示例来源:origin: org.jooq/jool-java-8

/**
 * Wrap a {@link CheckedDoubleConsumer} in a {@link DoubleConsumer}.
 * <p>
 * Example:
 * <code><pre>
 * Arrays.stream(new double[] { 1.0, 2.0 }).forEach(Unchecked.doubleConsumer(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 * }));
 * </pre></code>
 */
public static DoubleConsumer doubleConsumer(CheckedDoubleConsumer consumer) {
  return doubleConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
}

代码示例来源:origin: org.jooq/jool-java-8

/**
 * Wrap a {@link CheckedDoubleConsumer} in a {@link DoubleConsumer}.
 * <p>
 * Example:
 * <code><pre>
 * Arrays.stream(new double[] { 1.0, 2.0 }).forEach(Unchecked.doubleConsumer(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 * }));
 * </pre></code>
 */
public static DoubleConsumer doubleConsumer(CheckedDoubleConsumer consumer) {
  return Unchecked.doubleConsumer(consumer, Unchecked.RETHROW_ALL);
}

相关文章