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