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

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

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

Unchecked.doublePredicate介绍

[英]Wrap a CheckedDoublePredicate in a DoublePredicate.

Example: ``

DoubleStream.of(1.0, 2.0, 3.0).filter(Unchecked.doublePredicate(d -> { 
if (d < 0.0) 
throw new Exception("Only positive numbers allowed"); 
return true; 
}));

[中]将CheckedDoublePredicate包装为DoublePredicate。
示例:``

DoubleStream.of(1.0, 2.0, 3.0).filter(Unchecked.doublePredicate(d -> { 
if (d < 0.0) 
throw new Exception("Only positive numbers allowed"); 
return true; 
}));

代码示例

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

/**
 * @see {@link Unchecked#doublePredicate(CheckedDoublePredicate)}
 */
static DoublePredicate unchecked(CheckedDoublePredicate predicate) {
  return Unchecked.doublePredicate(predicate);
}

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

/**
 * @see {@link Unchecked#doublePredicate(CheckedDoublePredicate)}
 */
static DoublePredicate unchecked(CheckedDoublePredicate predicate) {
  return Unchecked.doublePredicate(predicate);
}

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

/**
   * @see {@link Unchecked#doublePredicate(CheckedDoublePredicate, Consumer)}
   */
  static DoublePredicate unchecked(CheckedDoublePredicate function, Consumer<Throwable> handler) {
    return Unchecked.doublePredicate(function, handler);
  }
}

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

/**
   * @see {@link Unchecked#doublePredicate(CheckedDoublePredicate, Consumer)}
   */
  static DoublePredicate unchecked(CheckedDoublePredicate function, Consumer<Throwable> handler) {
    return Unchecked.doublePredicate(function, handler);
  }
}

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

/**
 * Wrap a {@link CheckedDoublePredicate} in a {@link DoublePredicate}.
 * <p>
 * Example:
 * <code><pre>
 * DoubleStream.of(1.0, 2.0, 3.0).filter(Unchecked.doublePredicate(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return true;
 * }));
 * </pre></code>
 */
public static DoublePredicate doublePredicate(CheckedDoublePredicate predicate) {
  return Unchecked.doublePredicate(predicate, Unchecked.RETHROW_ALL);
}

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

/**
 * Wrap a {@link CheckedDoublePredicate} in a {@link DoublePredicate}.
 * <p>
 * Example:
 * <code><pre>
 * DoubleStream.of(1.0, 2.0, 3.0).filter(Unchecked.doublePredicate(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return true;
 * }));
 * </pre></code>
 */
public static DoublePredicate doublePredicate(CheckedDoublePredicate predicate) {
  return doublePredicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
}

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

/**
 * Wrap a {@link CheckedDoublePredicate} in a {@link DoublePredicate}.
 * <p>
 * Example:
 * <code><pre>
 * DoubleStream.of(1.0, 2.0, 3.0).filter(Unchecked.doublePredicate(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return true;
 * }));
 * </pre></code>
 */
public static DoublePredicate doublePredicate(CheckedDoublePredicate predicate) {
  return doublePredicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
}

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

/**
 * Wrap a {@link CheckedDoublePredicate} in a {@link DoublePredicate}.
 * <p>
 * Example:
 * <code><pre>
 * DoubleStream.of(1.0, 2.0, 3.0).filter(Unchecked.doublePredicate(d -> {
 *     if (d &lt; 0.0)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return true;
 * }));
 * </pre></code>
 */
public static DoublePredicate doublePredicate(CheckedDoublePredicate predicate) {
  return Unchecked.doublePredicate(predicate, Unchecked.RETHROW_ALL);
}

相关文章