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

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

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

Unchecked.booleanSupplier介绍

[英]Wrap a org.jooq.lambda.fi.util.function.CheckedBooleanSupplier in a BooleanSupplier.

Example: ``

ResultSet rs = statement.executeQuery(); 
Stream.generate(Unchecked.booleanSupplier(() -> rs.getBoolean(1)));

[中]包装一个组织。约克。拉姆达。菲。util。作用在布尔供应商中检查布尔供应商。
示例:``

ResultSet rs = statement.executeQuery(); 
Stream.generate(Unchecked.booleanSupplier(() -> rs.getBoolean(1)));

代码示例

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

/**
 * Wrap a {@link org.jooq.lambda.fi.util.function.CheckedBooleanSupplier} in a {@link BooleanSupplier}.
 * <p>
 * Example:
 * <code><pre>
 * ResultSet rs = statement.executeQuery();
 * Stream.generate(Unchecked.booleanSupplier(() -> rs.getBoolean(1)));
 * </pre></code>
 */
public static BooleanSupplier booleanSupplier(CheckedBooleanSupplier supplier) {
  return booleanSupplier(supplier, THROWABLE_TO_RUNTIME_EXCEPTION);
}

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

/**
 * @see {@link Unchecked#booleanSupplier(CheckedBooleanSupplier)}
 */
static BooleanSupplier unchecked(CheckedBooleanSupplier supplier) {
  return Unchecked.booleanSupplier(supplier);
}

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

/**
   * @see {@link Unchecked#booleanSupplier(CheckedBooleanSupplier, Consumer)}
   */
  static BooleanSupplier unchecked(CheckedBooleanSupplier supplier, Consumer<Throwable> handler) {
    return Unchecked.booleanSupplier(supplier, handler);
  }
}

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

/**
 * Wrap a {@link org.jooq.lambda.fi.util.function.CheckedBooleanSupplier} in a {@link BooleanSupplier}.
 * <p>
 * Example:
 * <code><pre>
 * ResultSet rs = statement.executeQuery();
 * Stream.generate(Unchecked.booleanSupplier(() -> rs.getBoolean(1)));
 * </pre></code>
 */
public static BooleanSupplier booleanSupplier(CheckedBooleanSupplier supplier) {
  return Unchecked.booleanSupplier(supplier, Unchecked.RETHROW_ALL);
}

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

/**
 * @see {@link Unchecked#booleanSupplier(CheckedBooleanSupplier)}
 */
static BooleanSupplier unchecked(CheckedBooleanSupplier supplier) {
  return Unchecked.booleanSupplier(supplier);
}

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

/**
   * @see {@link Unchecked#booleanSupplier(CheckedBooleanSupplier, Consumer)}
   */
  static BooleanSupplier unchecked(CheckedBooleanSupplier supplier, Consumer<Throwable> handler) {
    return Unchecked.booleanSupplier(supplier, handler);
  }
}

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

/**
 * Wrap a {@link org.jooq.lambda.fi.util.function.CheckedBooleanSupplier} in a {@link BooleanSupplier}.
 * <p>
 * Example:
 * <code><pre>
 * ResultSet rs = statement.executeQuery();
 * Stream.generate(Unchecked.booleanSupplier(() -> rs.getBoolean(1)));
 * </pre></code>
 */
public static BooleanSupplier booleanSupplier(CheckedBooleanSupplier supplier) {
  return booleanSupplier(supplier, THROWABLE_TO_RUNTIME_EXCEPTION);
}

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

/**
 * Wrap a {@link org.jooq.lambda.fi.util.function.CheckedBooleanSupplier} in a {@link BooleanSupplier}.
 * <p>
 * Example:
 * <code><pre>
 * ResultSet rs = statement.executeQuery();
 * Stream.generate(Unchecked.booleanSupplier(() -> rs.getBoolean(1)));
 * </pre></code>
 */
public static BooleanSupplier booleanSupplier(CheckedBooleanSupplier supplier) {
  return Unchecked.booleanSupplier(supplier, Unchecked.RETHROW_ALL);
}

代码示例来源:origin: StubbornJava/StubbornJava

public boolean deleteUserByEmail(String email) {
  HttpUrl route = HttpUrl.parse(host + "/users")
              .newBuilder()
              .addPathSegment(email)
              .build();
  Request request = new Request.Builder().url(route).delete().build();
  return Unchecked.booleanSupplier(() -> {
    try (Response response = client.newCall(request).execute()) {
      if (response.code() == StatusCodes.NO_CONTENT) {
        return true;
      }
      // Maybe you would throw an exception here? We don't feel the need to.
      if (response.code() == StatusCodes.NOT_FOUND) {
        return false;
      }
      throw HttpClient.unknownException(response);
    }
  }).getAsBoolean();
}
// {{end:deleteUserByEmail}}

相关文章