<commit_before>/**
 *
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 *
 */

package com.microsoft.rest;

import com.google.common.util.concurrent.AbstractFuture;

import retrofit2.Call;

/**
 * An instance of this class provides access to the underlying REST call invocation.
 * This class wraps around the Retrofit Call object and allows updates to it in the
 * progress of a long running operation or a paging operation.
 *
 * @param <T> the type of the returning object
 */
public class ServiceCall<T> extends AbstractFuture<T> {
    /**
     * The Retrofit method invocation.
     */
    private Call<?> call;

    /**
     * Creates an instance of ServiceCall.
     *
     * @param call the Retrofit call to wrap around.
     */
    public ServiceCall(Call<?> call) {
        this.call = call;
    }

    /**
     * Updates the current Retrofit call object.
     *
     * @param call the new call object.
     */
    public void newCall(Call<?> call) {
        this.call = call;
    }

    /**
     * Gets the current Retrofit call object.
     *
     * @return the current call object.
     */
    public Call<?> getCall() {
        return call;
    }

    /**
     * Cancel the Retrofit call if possible.
     */
    public void cancel() {
        call.cancel();
    }

    /**
     * If the Retrofit call has been canceled.
     *
     * @return true if the call has been canceled; false otherwise.
     */
    public boolean isCanceled() {
        return call.isCanceled();
    }

    /**
     * Invoke this method to report completed, allowing
     * {@link AbstractFuture#get()} to be unblocked.
     *
     * @param result the object returned.
     * @return true if successfully reported; false otherwise.
     */
    public boolean success(T result) {
        return set(result);
    }

    /**
     * Invoke this method to report a failure, allowing
     * {@link AbstractFuture#get()} to throw the exception.
     *
     * @param t the exception thrown.
     * @return true if successfully reported; false otherwise.
     */
    public boolean failure(Throwable t) {
        return setException(t);
    }
}<commit_msg>Simply signature for async service calls<commit_after>/**
 *
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 *
 */

package com.microsoft.rest;

import com.google.common.util.concurrent.AbstractFuture;

import retrofit2.Call;

/**
 * An instance of this class provides access to the underlying REST call invocation.
 * This class wraps around the Retrofit Call object and allows updates to it in the
 * progress of a long running operation or a paging operation.
 *
 * @param <T> the type of the returning object
 */
public class ServiceCall<T> extends AbstractFuture<ServiceResponse<T>> {
    /**
     * The Retrofit method invocation.
     */
    private Call<?> call;

    /**
     * Creates an instance of ServiceCall.
     *
     * @param call the Retrofit call to wrap around.
     */
    public ServiceCall(Call<?> call) {
        this.call = call;
    }

    /**
     * Updates the current Retrofit call object.
     *
     * @param call the new call object.
     */
    public void newCall(Call<?> call) {
        this.call = call;
    }

    /**
     * Gets the current Retrofit call object.
     *
     * @return the current call object.
     */
    public Call<?> getCall() {
        return call;
    }

    /**
     * Cancel the Retrofit call if possible.
     */
    public void cancel() {
        call.cancel();
    }

    /**
     * If the Retrofit call has been canceled.
     *
     * @return true if the call has been canceled; false otherwise.
     */
    public boolean isCanceled() {
        return call.isCanceled();
    }

    /**
     * Invoke this method to report completed, allowing
     * {@link AbstractFuture#get()} to be unblocked.
     *
     * @param result the service response returned.
     * @return true if successfully reported; false otherwise.
     */
    public boolean success(ServiceResponse<T> result) {
        return set(result);
    }

    /**
     * Invoke this method to report a failure, allowing
     * {@link AbstractFuture#get()} to throw the exception.
     *
     * @param t the exception thrown.
     * @return true if successfully reported; false otherwise.
     */
    public boolean failure(Throwable t) {
        return setException(t);
    }
}
{'fraction_non_alphanumeric': 0.09647007235255427, 'fraction_numerical': 0.0004385003288752467, 'mean_word_length': 2.3081943437273384, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6271641', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1243, 'n_words': 470}