java.util.function.Function#toString ( )源码实例Demo

下面列出了java.util.function.Function#toString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: AVM   文件: NestedLambdaTarget.java
@Callable
public static void createLambda() {
    function = (s1) -> {
        Function<Integer, Integer> f2 = (i1) -> {
            Function<BigInteger, BigInteger> f3 = (bi1) -> {
                return bi1.add(bi1);
            };
            f3.hashCode();
            f3.toString();
            return ++i1 + f3.apply(new BigInteger("2389652398")).intValue();
        };
        f2.hashCode();
        f2.toString();
        return s1 + f2.apply(5);
    };
}
 
源代码2 项目: jparsec   文件: Parser.java
/**
 * A {@link Parser} that executes {@code this}, maps the result using {@code map} to another {@code Parser} object
 * to be executed as the next step.
 */
public final <To> Parser<To> next(
    final Function<? super T, ? extends Parser<? extends To>> map) {
  return new Parser<To>() {
    @Override boolean apply(ParseContext ctxt) {
      return Parser.this.apply(ctxt) && runNext(ctxt);
    }
    @Override public String toString() {
      return map.toString();
    }
    private boolean runNext(ParseContext state) {
      T from = Parser.this.getReturn(state);
      return map.apply(from).apply(state);
    }
  };
}
 
源代码3 项目: data-highway   文件: MessageBatcher.java
public MessageBatcher(
    int bufferSize,
    int maxBatchSize,
    EnqueueBehaviour enqueueBehaviour,
    Function<List<MESSAGE>, List<RESPONSE>> batchHandler) {
  this(bufferSize, maxBatchSize, enqueueBehaviour, batchHandler,
      r -> new Thread(r, "batcher-" + batchHandler.toString()));
}
 
源代码4 项目: teasy   文件: TeasyFluentWait.java
public <R> R waitFor(Function<? super T, R> condition) {
    try {
        return until(condition);
    } catch (Throwable ignoredAndContinue) {
        if (nullOnFailure) {
            //todo add some logging here if necessary
            return null;
        } else {
            throw new AssertionError("Condition: " + condition.toString() + " failed!");
        }
    }
}