Changed Future<Void> to Future<?>

Changed return values of Future<Void> to Future<?> in AsyncRestTemplate
and AsyncRestOperations.
This commit is contained in:
Arjen Poutsma
2013-09-02 15:33:16 +02:00
parent 79ddba5d01
commit e33324b700
3 changed files with 20 additions and 14 deletions

View File

@@ -192,57 +192,63 @@ public interface AsyncRestOperations {
/**
* Create or update a resource by PUTting the given object to the URI.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The Future will return a {@code null} result upon completion.
* @param url the URL
* @param request the Object to be PUT, may be {@code null}
* @param uriVariables the variables to expand the template
* @see HttpEntity
*/
Future<Void> put(String url, HttpEntity<?> request, Object... uriVariables)
Future<?> put(String url, HttpEntity<?> request, Object... uriVariables)
throws RestClientException;
/**
* Creates a new resource by PUTting the given object to URI template.
* <p>URI Template variables are expanded using the given map.
* <p>The Future will return a {@code null} result upon completion.
* @param url the URL
* @param request the Object to be PUT, may be {@code null}
* @param uriVariables the variables to expand the template
* @see HttpEntity
*/
Future<Void> put(String url, HttpEntity<?> request, Map<String, ?> uriVariables)
Future<?> put(String url, HttpEntity<?> request, Map<String, ?> uriVariables)
throws RestClientException;
/**
* Creates a new resource by PUTting the given object to URL.
* <p>The Future will return a {@code null} result upon completion.
* @param url the URL
* @param request the Object to be PUT, may be {@code null}
* @see HttpEntity
*/
Future<Void> put(URI url, HttpEntity<?> request) throws RestClientException;
Future<?> put(URI url, HttpEntity<?> request) throws RestClientException;
// DELETE
/**
* Asynchronously delete the resources at the specified URI.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The Future will return a {@code null} result upon completion.
* @param url the URL
* @param uriVariables the variables to expand in the template
*/
Future<Void> delete(String url, Object... uriVariables) throws RestClientException;
Future<?> delete(String url, Object... uriVariables) throws RestClientException;
/**
* Asynchronously delete the resources at the specified URI.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The Future will return a {@code null} result upon completion.
* @param url the URL
* @param uriVariables the variables to expand in the template
*/
Future<Void> delete(String url, Map<String, ?> uriVariables) throws RestClientException;
Future<?> delete(String url, Map<String, ?> uriVariables) throws RestClientException;
/**
* Asynchronously delete the resources at the specified URI.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The Future will return a {@code null} result upon completion.
* @param url the URL
*/
Future<Void> delete(URI url) throws RestClientException;
Future<?> delete(URI url) throws RestClientException;
// OPTIONS

View File

@@ -304,21 +304,21 @@ public class AsyncRestTemplate extends AsyncHttpAccessor implements AsyncRestOpe
// PUT
@Override
public Future<Void> put(String url, HttpEntity<?> request, Object... uriVariables)
public Future<?> put(String url, HttpEntity<?> request, Object... uriVariables)
throws RestClientException {
AsyncRequestCallback requestCallback = httpEntityCallback(request);
return execute(url, HttpMethod.PUT, requestCallback, null, uriVariables);
}
@Override
public Future<Void> put(String url, HttpEntity<?> request,
public Future<?> put(String url, HttpEntity<?> request,
Map<String, ?> uriVariables) throws RestClientException {
AsyncRequestCallback requestCallback = httpEntityCallback(request);
return execute(url, HttpMethod.PUT, requestCallback, null, uriVariables);
}
@Override
public Future<Void> put(URI url, HttpEntity<?> request) throws RestClientException {
public Future<?> put(URI url, HttpEntity<?> request) throws RestClientException {
AsyncRequestCallback requestCallback = httpEntityCallback(request);
return execute(url, HttpMethod.PUT, requestCallback, null);
}
@@ -326,19 +326,19 @@ public class AsyncRestTemplate extends AsyncHttpAccessor implements AsyncRestOpe
// DELETE
@Override
public Future<Void> delete(String url, Object... urlVariables)
public Future<?> delete(String url, Object... urlVariables)
throws RestClientException {
return execute(url, HttpMethod.DELETE, null, null, urlVariables);
}
@Override
public Future<Void> delete(String url, Map<String, ?> urlVariables)
public Future<?> delete(String url, Map<String, ?> urlVariables)
throws RestClientException {
return execute(url, HttpMethod.DELETE, null, null, urlVariables);
}
@Override
public Future<Void> delete(URI url) throws RestClientException {
public Future<?> delete(URI url) throws RestClientException {
return execute(url, HttpMethod.DELETE, null, null);
}