本文整理了Java中org.jooq.lambda.Unchecked.doubleBinaryOperator()
方法的一些代码示例,展示了Unchecked.doubleBinaryOperator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unchecked.doubleBinaryOperator()
方法的具体详情如下:
包路径:org.jooq.lambda.Unchecked
类名称:Unchecked
方法名:doubleBinaryOperator
[英]Wrap a CheckedDoubleBinaryOperator in a DoubleBinaryOperator.
Example: ``
DoubleStream.of(1.0, 2.0, 3.0).reduce(Unchecked.doubleBinaryOperator((d1, d2) -> {
if (d2 < 0.0)
throw new Exception("Only positive numbers allowed");
return d1 + d2;
}));
[中]将CheckedDoubleBinaryOperator包装为DoubleBinaryOperator。
示例:``
DoubleStream.of(1.0, 2.0, 3.0).reduce(Unchecked.doubleBinaryOperator((d1, d2) -> {
if (d2 < 0.0)
throw new Exception("Only positive numbers allowed");
return d1 + d2;
}));
代码示例来源:origin: org.jooq/jool
/**
* @see {@link Unchecked#doubleBinaryOperator(CheckedDoubleBinaryOperator)}
*/
static DoubleBinaryOperator unchecked(CheckedDoubleBinaryOperator operator) {
return Unchecked.doubleBinaryOperator(operator);
}
代码示例来源:origin: org.jooq/jool-java-8
/**
* @see {@link Unchecked#doubleBinaryOperator(CheckedDoubleBinaryOperator, Consumer)}
*/
static DoubleBinaryOperator unchecked(CheckedDoubleBinaryOperator operator, Consumer<Throwable> handler) {
return Unchecked.doubleBinaryOperator(operator, handler);
}
}
代码示例来源:origin: org.jooq/jool
/**
* @see {@link Unchecked#doubleBinaryOperator(CheckedDoubleBinaryOperator, Consumer)}
*/
static DoubleBinaryOperator unchecked(CheckedDoubleBinaryOperator operator, Consumer<Throwable> handler) {
return Unchecked.doubleBinaryOperator(operator, handler);
}
}
代码示例来源:origin: org.jooq/jool-java-8
/**
* @see {@link Unchecked#doubleBinaryOperator(CheckedDoubleBinaryOperator)}
*/
static DoubleBinaryOperator unchecked(CheckedDoubleBinaryOperator operator) {
return Unchecked.doubleBinaryOperator(operator);
}
代码示例来源:origin: org.jooq/jool
/**
* Wrap a {@link CheckedDoubleBinaryOperator} in a {@link DoubleBinaryOperator}.
* <p>
* Example:
* <code><pre>
* DoubleStream.of(1.0, 2.0, 3.0).reduce(Unchecked.doubleBinaryOperator((d1, d2) -> {
* if (d2 < 0.0)
* throw new Exception("Only positive numbers allowed");
*
* return d1 + d2;
* }));
* </pre></code>
*/
public static DoubleBinaryOperator doubleBinaryOperator(CheckedDoubleBinaryOperator operator) {
return Unchecked.doubleBinaryOperator(operator, Unchecked.RETHROW_ALL);
}
代码示例来源:origin: org.jooq/jool
/**
* Wrap a {@link CheckedDoubleBinaryOperator} in a {@link DoubleBinaryOperator}.
* <p>
* Example:
* <code><pre>
* DoubleStream.of(1.0, 2.0, 3.0).reduce(Unchecked.doubleBinaryOperator((d1, d2) -> {
* if (d2 < 0.0)
* throw new Exception("Only positive numbers allowed");
*
* return d1 + d2;
* }));
* </pre></code>
*/
public static DoubleBinaryOperator doubleBinaryOperator(CheckedDoubleBinaryOperator operator) {
return doubleBinaryOperator(operator, THROWABLE_TO_RUNTIME_EXCEPTION);
}
代码示例来源:origin: org.jooq/jool-java-8
/**
* Wrap a {@link CheckedDoubleBinaryOperator} in a {@link DoubleBinaryOperator}.
* <p>
* Example:
* <code><pre>
* DoubleStream.of(1.0, 2.0, 3.0).reduce(Unchecked.doubleBinaryOperator((d1, d2) -> {
* if (d2 < 0.0)
* throw new Exception("Only positive numbers allowed");
*
* return d1 + d2;
* }));
* </pre></code>
*/
public static DoubleBinaryOperator doubleBinaryOperator(CheckedDoubleBinaryOperator operator) {
return Unchecked.doubleBinaryOperator(operator, Unchecked.RETHROW_ALL);
}
代码示例来源:origin: org.jooq/jool-java-8
/**
* Wrap a {@link CheckedDoubleBinaryOperator} in a {@link DoubleBinaryOperator}.
* <p>
* Example:
* <code><pre>
* DoubleStream.of(1.0, 2.0, 3.0).reduce(Unchecked.doubleBinaryOperator((d1, d2) -> {
* if (d2 < 0.0)
* throw new Exception("Only positive numbers allowed");
*
* return d1 + d2;
* }));
* </pre></code>
*/
public static DoubleBinaryOperator doubleBinaryOperator(CheckedDoubleBinaryOperator operator) {
return doubleBinaryOperator(operator, THROWABLE_TO_RUNTIME_EXCEPTION);
}
内容来源于网络,如有侵权,请联系作者删除!