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

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

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

Unchecked.longUnaryOperator介绍

[英]Wrap a CheckedLongUnaryOperator in a LongUnaryOperator.

Example: ``

LongStream.of(1L, 2L, 3L).map(Unchecked.longUnaryOperator(l -> { 
if (l < 0L) 
throw new Exception("Only positive numbers allowed"); 
return l; 
}));

[中]将选中的LongUnaryOperator包装到LongUnaryOperator中。
示例:``

LongStream.of(1L, 2L, 3L).map(Unchecked.longUnaryOperator(l -> { 
if (l < 0L) 
throw new Exception("Only positive numbers allowed"); 
return l; 
}));

代码示例

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

/**
   * @see {@link Unchecked#longUnaryOperator(CheckedLongUnaryOperator, Consumer)}
   */
  static LongUnaryOperator unchecked(CheckedLongUnaryOperator operator, Consumer<Throwable> handler) {
    return Unchecked.longUnaryOperator(operator, handler);
  }
}

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

/**
 * @see {@link Unchecked#longUnaryOperator(CheckedLongUnaryOperator)}
 */
static LongUnaryOperator unchecked(CheckedLongUnaryOperator operator) {
  return Unchecked.longUnaryOperator(operator);
}

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

/**
 * @see {@link Unchecked#longUnaryOperator(CheckedLongUnaryOperator)}
 */
static LongUnaryOperator unchecked(CheckedLongUnaryOperator operator) {
  return Unchecked.longUnaryOperator(operator);
}

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

/**
   * @see {@link Unchecked#longUnaryOperator(CheckedLongUnaryOperator, Consumer)}
   */
  static LongUnaryOperator unchecked(CheckedLongUnaryOperator operator, Consumer<Throwable> handler) {
    return Unchecked.longUnaryOperator(operator, handler);
  }
}

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

/**
 * Wrap a {@link CheckedLongUnaryOperator} in a {@link LongUnaryOperator}.
 * <p>
 * Example:
 * <code><pre>
 * LongStream.of(1L, 2L, 3L).map(Unchecked.longUnaryOperator(l -> {
 *     if (l &lt; 0L)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return l;
 * }));
 * </pre></code>
 */
public static LongUnaryOperator longUnaryOperator(CheckedLongUnaryOperator operator) {
  return longUnaryOperator(operator, THROWABLE_TO_RUNTIME_EXCEPTION);
}

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

/**
 * Wrap a {@link CheckedLongUnaryOperator} in a {@link LongUnaryOperator}.
 * <p>
 * Example:
 * <code><pre>
 * LongStream.of(1L, 2L, 3L).map(Unchecked.longUnaryOperator(l -> {
 *     if (l &lt; 0L)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return l;
 * }));
 * </pre></code>
 */
public static LongUnaryOperator longUnaryOperator(CheckedLongUnaryOperator operator) {
  return Unchecked.longUnaryOperator(operator, Unchecked.RETHROW_ALL);
}

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

/**
 * Wrap a {@link CheckedLongUnaryOperator} in a {@link LongUnaryOperator}.
 * <p>
 * Example:
 * <code><pre>
 * LongStream.of(1L, 2L, 3L).map(Unchecked.longUnaryOperator(l -> {
 *     if (l &lt; 0L)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return l;
 * }));
 * </pre></code>
 */
public static LongUnaryOperator longUnaryOperator(CheckedLongUnaryOperator operator) {
  return longUnaryOperator(operator, THROWABLE_TO_RUNTIME_EXCEPTION);
}

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

/**
 * Wrap a {@link CheckedLongUnaryOperator} in a {@link LongUnaryOperator}.
 * <p>
 * Example:
 * <code><pre>
 * LongStream.of(1L, 2L, 3L).map(Unchecked.longUnaryOperator(l -> {
 *     if (l &lt; 0L)
 *         throw new Exception("Only positive numbers allowed");
 *
 *     return l;
 * }));
 * </pre></code>
 */
public static LongUnaryOperator longUnaryOperator(CheckedLongUnaryOperator operator) {
  return Unchecked.longUnaryOperator(operator, Unchecked.RETHROW_ALL);
}

相关文章