Simplify upgradeCodecFactory()
[netconf.git] / transport / transport-http / src / main / java / org / opendaylight / netconf / transport / http / ServerChannelInitializer.java
index 642fd6fa1ff7472fb966a974927547bc62bed1e5..0ce9d516232cd1adf29cf1eef9c264940962e36b 100644 (file)
@@ -150,13 +150,8 @@ class ServerChannelInitializer extends ChannelInitializer<Channel> implements Ht
 
     private static HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory(
             final Http2ConnectionHandler connectionHandler) {
-        return protocol -> {
-            if (AsciiString.contentEquals(Http2CodecUtil.HTTP_UPGRADE_PROTOCOL_NAME, protocol)) {
-                return new Http2ServerUpgradeCodec(connectionHandler);
-            } else {
-                return null;
-            }
-        };
+        return protocol -> AsciiString.contentEquals(Http2CodecUtil.HTTP_UPGRADE_PROTOCOL_NAME, protocol)
+            ? new Http2ServerUpgradeCodec(connectionHandler) : null;
     }
 
     private static ChannelHandler serverHandler(final RequestDispatcher dispatcher) {