Skip to content

Commit

Permalink
Further encapsulate HttpClient internals
Browse files Browse the repository at this point in the history
  • Loading branch information
SMadani committed May 22, 2024
1 parent 418a9e6 commit 8eb24a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/vonage/client/AbstractMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public String getApplicationIdOrApiKey() throws VonageUnexpectedException {
*
* @throws UnsupportedEncodingException if UTF-8 encoding is not supported by the JVM
*/
public abstract RequestBuilder makeRequest(RequestT request) throws UnsupportedEncodingException;
protected abstract RequestBuilder makeRequest(RequestT request) throws UnsupportedEncodingException;

/**
* Construct a ResultT representing the contents of the HTTP response returned from the Vonage Voice API.
Expand All @@ -181,5 +181,5 @@ public String getApplicationIdOrApiKey() throws VonageUnexpectedException {
*
* @throws IOException if a problem occurs parsing the response
*/
public abstract ResultT parseResponse(HttpResponse response) throws IOException;
protected abstract ResultT parseResponse(HttpResponse response) throws IOException;
}
4 changes: 2 additions & 2 deletions src/main/java/com/vonage/client/DynamicEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ else if (requestBody instanceof BinaryRequest) {
}

@Override
public final RequestBuilder makeRequest(T requestBody) {
protected final RequestBuilder makeRequest(T requestBody) {
if (requestBody instanceof Jsonable && responseType.isAssignableFrom(requestBody.getClass())) {
cachedRequestBody = requestBody;
}
Expand Down Expand Up @@ -227,7 +227,7 @@ else if (requestBody instanceof byte[]) {
}

@Override
public final R parseResponse(HttpResponse response) throws IOException {
protected final R parseResponse(HttpResponse response) throws IOException {
int statusCode = response.getStatusLine().getStatusCode();
try {
if (statusCode >= 200 && statusCode < 300) {
Expand Down

0 comments on commit 8eb24a3

Please sign in to comment.