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