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