Replace lambda with method reference

This commit is contained in:
Guido Lena Cota
2018-10-15 23:05:26 +02:00
parent 5c36c8ae77
commit bdb0913dd8
2 changed files with 2 additions and 2 deletions

View File

@@ -182,7 +182,7 @@ http POST :8080/admin/gateway/routes/apiaddreqhead uri=http://httpbin.org:80 pre
return this.routeDefinitionLocator.getRouteDefinitions()
.filter(route -> route.getId().equals(id))
.singleOrEmpty()
.map(route -> ResponseEntity.ok(route))
.map(ResponseEntity::ok)
.switchIfEmpty(Mono.just(ResponseEntity.notFound().build()));
}

View File

@@ -39,7 +39,7 @@ public class CachingRouteDefinitionLocator implements RouteDefinitionLocator {
public CachingRouteDefinitionLocator(RouteDefinitionLocator delegate) {
this.delegate = delegate;
routeDefinitions = CacheFlux.lookup(cache, "routeDefs", RouteDefinition.class)
.onCacheMissResume(() -> this.delegate.getRouteDefinitions());
.onCacheMissResume(this.delegate::getRouteDefinitions);
}