class User {

    public void login(final LoginInterface loginInterface) {
        if (webService.isNetworkOffline()) {
            loginInterface.onLoginFailed();
            return;
        }

        Response response = new Response() {
            @Override
            public void onRequestCompleted(boolean isSuccess, String data) {
                if (isSuccess) {
                    loginInterface.onLoginSuccess();
                } else {
                    loginInterface.onLoginFailed();
                }
            }
        };
        webService.login(userId, password, response);
    }

    public  User(WebService webService, int userId, String password);

}