Turned on checkstyle
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017-2018 the original author or authors.
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,8 @@ package com.example;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.function.compiler.FunctionCompiler;
|
||||
@@ -26,11 +28,14 @@ import org.springframework.cloud.function.compiler.proxy.LambdaCompilingFunction
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
// @checkstyle:off
|
||||
@SpringBootApplication
|
||||
public class SampleApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(SampleApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return value -> value.toUpperCase();
|
||||
@@ -52,17 +57,21 @@ public class SampleApplication {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Function<String, String> compiledUppercase(FunctionCompiler<String, String> compiler) {
|
||||
public Function<String, String> compiledUppercase(
|
||||
FunctionCompiler<String, String> compiler) {
|
||||
String lambda = "s -> s.toUpperCase()";
|
||||
LambdaCompilingFunction<String, String> function = new LambdaCompilingFunction<>(new ByteArrayResource(lambda.getBytes()), compiler);
|
||||
LambdaCompilingFunction<String, String> function = new LambdaCompilingFunction<>(
|
||||
new ByteArrayResource(lambda.getBytes()), compiler);
|
||||
function.setTypeParameterizations("String", "String");
|
||||
return function;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Function<Flux<String>, Flux<String>> compiledLowercase(FunctionCompiler<Flux<String>, Flux<String>> compiler) {
|
||||
public Function<Flux<String>, Flux<String>> compiledLowercase(
|
||||
FunctionCompiler<Flux<String>, Flux<String>> compiler) {
|
||||
String lambda = "f->f.map(o->o.toString().toLowerCase())";
|
||||
return new LambdaCompilingFunction<>(new ByteArrayResource(lambda.getBytes()), compiler);
|
||||
return new LambdaCompilingFunction<>(new ByteArrayResource(lambda.getBytes()),
|
||||
compiler);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -70,7 +79,5 @@ public class SampleApplication {
|
||||
return new FunctionCompiler<>();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(SampleApplication.class, args);
|
||||
}
|
||||
}
|
||||
// @checkstyle:on
|
||||
|
||||
Reference in New Issue
Block a user