Skip to content

Commit ddb76c5

Browse files
committed
Merge branch 'tidy' of https://github.com/RohanTalip/sendgrid-java into RohanTalip-tidy
2 parents 527db21 + e2e146b commit ddb76c5

19 files changed

Lines changed: 887 additions & 562 deletions
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
package com.sendgrid;
22

33
/**
4-
* An interface describing a callback mechanism for the
5-
* asynchronous, rate limit aware API connection.
4+
* An interface describing a callback mechanism for the asynchronous, rate limit aware API
5+
* connection.
66
*/
77
public interface APICallback {
8-
/**
9-
* Callback method in case of an error.
10-
* @param ex the error that was thrown.
11-
*/
12-
void error(Exception ex);
138

14-
/**
15-
* Callback method in case of a valid response.
16-
* @param response the valid response.
17-
*/
18-
void response(Response response);
9+
/**
10+
* Callback method in case of an error.
11+
*
12+
* @param ex the error that was thrown.
13+
*/
14+
void error(Exception ex);
15+
16+
/**
17+
* Callback method in case of a valid response.
18+
*
19+
* @param response the valid response.
20+
*/
21+
void response(Response response);
1922
}
Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
package com.sendgrid;
22

33
/**
4-
* An exception thrown when the maximum number of retries
5-
* have occurred, and the API calls are still rate limited.
4+
* An exception thrown when the maximum number of retries have occurred, and the API calls are still
5+
* rate limited.
66
*/
77
public class RateLimitException extends Exception {
8-
private final Request request;
9-
private final int retryCount;
108

11-
/**
12-
* Construct a new exception.
13-
* @param request the originating request object.
14-
* @param retryCount the number of times a retry was attempted.
15-
*/
16-
public RateLimitException(Request request, int retryCount) {
17-
this.request = request;
18-
this.retryCount = retryCount;
19-
}
9+
private final Request request;
10+
private final int retryCount;
2011

21-
/**
22-
* Get the originating request object.
23-
* @return the request object.
24-
*/
25-
public Request getRequest() {
26-
return this.request;
27-
}
12+
/**
13+
* Construct a new exception.
14+
*
15+
* @param request the originating request object.
16+
* @param retryCount the number of times a retry was attempted.
17+
*/
18+
public RateLimitException(Request request, int retryCount) {
19+
this.request = request;
20+
this.retryCount = retryCount;
21+
}
2822

29-
/**
30-
* Get the number of times the action was attemted.
31-
* @return the retry count.
32-
*/
33-
public int getRetryCount() {
34-
return this.retryCount;
35-
}
23+
/**
24+
* Get the originating request object.
25+
*
26+
* @return the request object.
27+
*/
28+
public Request getRequest() {
29+
return this.request;
30+
}
31+
32+
/**
33+
* Get the number of times the action was attemted.
34+
*
35+
* @return the retry count.
36+
*/
37+
public int getRetryCount() {
38+
return this.retryCount;
39+
}
3640
}

0 commit comments

Comments
 (0)