Skip to content

openvidu-java-client : change to lambda function#821

Open
lastname-dev wants to merge 2 commits intoOpenVidu:masterfrom
lastname-dev:lambda-fix
Open

openvidu-java-client : change to lambda function#821
lastname-dev wants to merge 2 commits intoOpenVidu:masterfrom
lastname-dev:lambda-fix

Conversation

@lastname-dev
Copy link
Copy Markdown

HttpClientResponseHandler<Connection> responseHandler = response -> {
    int status = response.getCode();
    if (status == 200) {
        Connection connection = new Connection(OpenVidu.httpResponseEntityToJson(response.getEntity()));
        Session.this.connections.put(connection.getConnectionId(), connection);
        return connection;
    } else {
        throw OpenVidu.openViduHttpException(status);
    }
};

In this code, the HttpClientResponseHandler is converted to a lambda function, taking response as a parameter and implementing the handleResponse method. This change simplifies the code while maintaining the same functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant