The lamda we return here is a simple if-else return.
JIRA: NETCONF-1248
Change-Id: Ia772eba569ccf9c0559abfab086772dbf31dce1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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) {